forked from verdnatura/salix-front
32 lines
1.1 KiB
JavaScript
32 lines
1.1 KiB
JavaScript
/// <reference types="cypress" />
|
|
describe('ParkingList', () => {
|
|
const firstCard = '.q-card:nth-child(1)';
|
|
const firstChipId =
|
|
':nth-child(1) > :nth-child(1) > .justify-between > .flex > .q-chip > .q-chip__content';
|
|
const firstDetailBtn =
|
|
':nth-child(1) > :nth-child(1) > .card-list-body > .actions > .q-btn';
|
|
const summaryHeader = '.summaryBody .header';
|
|
const screen = '.q-page-container > .q-drawer-container > .fullscreen';
|
|
|
|
beforeEach(() => {
|
|
cy.login('developer');
|
|
cy.visit(`/#/parking/list`);
|
|
cy.get(screen).click();
|
|
});
|
|
|
|
it('should redirect on clicking a invoice', () => {
|
|
cy.get(firstChipId)
|
|
.invoke('text')
|
|
.then((content) => {
|
|
const id = content.substring(4);
|
|
cy.get(firstCard).click();
|
|
cy.url().should('include', `/parking/${id}/summary`);
|
|
});
|
|
});
|
|
|
|
it('should open the details', () => {
|
|
cy.get(firstDetailBtn).click();
|
|
cy.get(summaryHeader).contains('Basic data');
|
|
});
|
|
});
|