zp tab focus tests pass if run on their own (#4183)

Make sure that more than one tab is opened before tab navigation
tests are run so that the tabs menu is always focusable.

Fixes: #4180
This commit is contained in:
abaevbog 2024-05-31 05:54:26 -04:00 committed by GitHub
parent 6ecfc7e34d
commit e7c7367509
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1501,6 +1501,13 @@ describe("ZoteroPane", function() {
await item.saveTx({
skipSelect: true
});
// Make sure there is more than one tab so that the tabs menu is focusable
if (win.Zotero_Tabs.numTabs == 1) {
let attachment = await importFileAttachment('test.pdf');
await attachment.saveTx();
await zp.viewAttachment(attachment.id);
win.Zotero_Tabs.select('zotero-pane');
}
await waitForItemsLoad(win);
await zp.collectionsView.selectLibrary(userLibraryID);
});