test: ctrl click

This commit is contained in:
Javier Segarra 2025-03-16 10:44:04 +01:00
parent 7510611c0b
commit 8417411efc
1 changed files with 14 additions and 1 deletions

View File

@ -10,8 +10,21 @@ describe('Monitor Tickets Table', () => {
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.openFilterPanel();
});
it.only('should open new tab when ctrl+click on client link', () => {
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
it.only('should filter by column headers and update URL params', () => {
// Mock window.open behavior since Cypress doesn't support multiple tabs
cy.window().then((win) => {
cy.stub(win, 'open').as('windowOpen');
});
// Find and ctrl+click the client link in first row
cy.get(firstRow('provinceFk')).click({ ctrlKey: true });
// Verify window.open was called with correct URL
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
});
it('should filter by column headers and update URL params', () => {
cy.intercept('GET', '**/SalesMonitors/salesFilter*').as('filterRequest');
cy.dataCy('column-filter-id').find(' [data-cy="_input"]').type('13');