From 2bd80b2ee7abf9cc4a3973a20dde1226ad021574 Mon Sep 17 00:00:00 2001 From: Jon Date: Mon, 9 Sep 2024 09:45:30 +0200 Subject: [PATCH] perf: refs #7889 perf shortcut test --- .../vnComponent/VnShortcut.spec.js | 30 +++++++++---------- 1 file changed, 15 insertions(+), 15 deletions(-) diff --git a/test/cypress/integration/vnComponent/VnShortcut.spec.js b/test/cypress/integration/vnComponent/VnShortcut.spec.js index 59dd397c3..b49b4e964 100644 --- a/test/cypress/integration/vnComponent/VnShortcut.spec.js +++ b/test/cypress/integration/vnComponent/VnShortcut.spec.js @@ -1,4 +1,5 @@ /// + describe('VnShortcuts', () => { const modules = { item: 'a', @@ -7,27 +8,26 @@ describe('VnShortcuts', () => { claim: 'r', worker: 'w', monitor: 'm', - order: 'p', + order: 'o', supplier: 'p', entry: 'e', zone: 'z', account: 'u', }; - - it('should visit each module', () => { + beforeEach(() => { cy.login('developer'); cy.visit('/'); - Object.keys(modules).forEach((module) => { - const shortcut = modules[module]; - - cy.get('body').click(); - cy.get('body').type(`{ctrl+alt+${shortcut}}`); - - if (shortcut != 'u' && shortcut != 'o') { - cy.get('.q-table__middle').should('be.visible'); - } - - cy.visit('/'); - }); }); + + for (const [module, shortcut] of Object.entries(modules)) { + it(`should visit ${module} module`, () => { + cy.get('body').trigger('keydown', { + ctrlKey: true, + altKey: true, + code: `Key${shortcut.toUpperCase()}`, + }); + + cy.url().should('include', module); + }); + } });