test: find the reader's Archive and Delete by their tooltips with the key

The toolbar tooltips are now the label plus the menus' key ("archive
(E)", "delete (Del)") instead of the old tooltip strings, so the tests
look for those.
This commit is contained in:
Linus Rath
2026-11-04 11:52:09 +01:00
parent ee33f9ef29
commit f2fb56698d
2 changed files with 4 additions and 4 deletions
@@ -82,13 +82,13 @@ function viewer() {
describe('the viewer and the Archive action gate', () => {
it('shows the Archive button while the gate is on', () => {
viewer();
expect(screen.getByTitle('tooltips.archive')).toBeInTheDocument();
expect(screen.getByTitle('archive (E)')).toBeInTheDocument();
});
it('has no Archive button with the gate off, Delete still there', () => {
setArchiveGate(false);
viewer();
expect(screen.queryByTitle('tooltips.archive')).toBeNull();
expect(screen.getByTitle('tooltips.delete')).toBeInTheDocument();
expect(screen.queryByTitle('archive (E)')).toBeNull();
expect(screen.getByTitle('delete (Del)')).toBeInTheDocument();
});
});
@@ -56,7 +56,7 @@ async function viewer(folder: string, h = handlers()) {
return h;
}
const archiveButton = () => document.querySelector('button[title="tooltips.archive"]');
const archiveButton = () => document.querySelector('button[title="archive (E)"]');
beforeEach(() => {
useSettingsStore.setState({ deleteAction: 'trash', permanentlyDeleteJunk: false, quickReplyEnabled: true });