0
0
Fork 0

perf: refs #7889 perf shortcut test

This commit is contained in:
Jon Elias 2024-09-09 09:45:30 +02:00
parent de08ae81a3
commit 2bd80b2ee7
1 changed files with 15 additions and 15 deletions

View File

@ -1,4 +1,5 @@
/// <reference types="cypress" />
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);
});
}
});