test: check url scopeDays para value
This commit is contained in:
parent
ee4eafc639
commit
4c4d7c9dbe
|
@ -233,9 +233,27 @@ describe('Monitor Tickets Table', () => {
|
|||
cy.get('[data-cy="Days onward_input"]').clear().type('2');
|
||||
cy.searchInFilterPanel();
|
||||
cy.get('.q-chip__content > span').should('have.text', '"2"');
|
||||
cy.waitSpinner();
|
||||
// Verify URL contains correct scopeDays value
|
||||
cy.url().then((url) => {
|
||||
const urlParams = new URLSearchParams(url.split('?')[1]);
|
||||
const saleMonitorTickets = JSON.parse(
|
||||
decodeURIComponent(urlParams.get('saleMonitorTickets')),
|
||||
);
|
||||
expect(saleMonitorTickets.scopeDays).to.equal(2);
|
||||
});
|
||||
cy.get('[data-cy="Days onward_input"]').clear();
|
||||
cy.get('[data-cy="Nickname_input"]').clear();
|
||||
cy.searchInFilterPanel();
|
||||
cy.get('.q-chip__content > span').should('have.text', '"0"');
|
||||
cy.waitSpinner();
|
||||
// Verify URL after clearing
|
||||
cy.url().then((url) => {
|
||||
const urlParams = new URLSearchParams(url.split('?')[1]);
|
||||
const saleMonitorTickets = JSON.parse(
|
||||
decodeURIComponent(urlParams.get('saleMonitorTickets')),
|
||||
);
|
||||
expect(saleMonitorTickets.scopeDays).to.equal(0);
|
||||
});
|
||||
});
|
||||
});
|
||||
function requestParams(key, value, options = { inWhere: false, like: false }) {
|
||||
|
|
Loading…
Reference in New Issue