67 lines
2.5 KiB
JavaScript
67 lines
2.5 KiB
JavaScript
describe('ZoneCalendar', { testIsolation: true }, () => {
|
|
const addEventBtn = '.q-page-sticky > div > .q-btn';
|
|
const submitBtn = '.q-mt-lg > .q-btn--standard';
|
|
const deleteBtn = 'ZoneEventsPanelDeleteBtn';
|
|
|
|
beforeEach(() => {
|
|
cy.login('developer');
|
|
cy.visit(`/#/zone/13/events`);
|
|
});
|
|
|
|
it('should include a one day event, then delete it', () => {
|
|
cy.get(addEventBtn).click();
|
|
cy.dataCy('ZoneEventInclusionDayRadio').click();
|
|
cy.get('.q-card > :nth-child(5)').type('01/01/2001');
|
|
cy.get(submitBtn).click();
|
|
cy.dataCy(deleteBtn).click();
|
|
cy.dataCy('VnConfirm_confirm').click();
|
|
});
|
|
|
|
it('should include an indefinitely event for monday and tuesday', () => {
|
|
cy.get(addEventBtn).click();
|
|
cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
|
|
cy.get('.flex > .q-gutter-x-sm > :nth-child(2)').click();
|
|
cy.get(submitBtn).click();
|
|
cy.dataCy(deleteBtn).click();
|
|
cy.dataCy('VnConfirm_confirm').click();
|
|
});
|
|
|
|
it('should include a range of dates event', () => {
|
|
cy.get(addEventBtn).click();
|
|
cy.dataCy('ZoneEventInclusionRangeRadio').click();
|
|
cy.get('.flex > .q-gutter-x-sm > :nth-child(1)').click();
|
|
cy.dataCy('From_inputDate').type('01/01/2001');
|
|
cy.dataCy('To_inputDate').type('31/01/2001');
|
|
cy.get(submitBtn).click();
|
|
cy.dataCy(deleteBtn).click();
|
|
cy.dataCy('VnConfirm_confirm').click();
|
|
});
|
|
|
|
it('should exclude an event', () => {
|
|
cy.get('.q-mb-sm > .q-radio__inner').click();
|
|
cy.get('.q-current-day > .q-calendar-month__day--label__wrapper').click();
|
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
cy.get(
|
|
'.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]',
|
|
).click();
|
|
cy.dataCy('ZoneEventExclusionDeleteBtn').click();
|
|
cy.dataCy('VnConfirm_confirm').click();
|
|
});
|
|
|
|
it(
|
|
'should not exclude an event if there are tickets for that zone and day',
|
|
{ testIsoaltion: true },
|
|
() => {
|
|
cy.visit(`/#/zone/3/events`);
|
|
cy.get('.q-mb-sm > .q-radio__inner').click();
|
|
cy.get(
|
|
'.q-current-day > .q-calendar-month__day--content > [data-cy="ZoneCalendarDay"]',
|
|
).click();
|
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
|
cy.checkNotification(
|
|
'Can not close this zone because there are tickets programmed for that day',
|
|
);
|
|
},
|
|
);
|
|
});
|