|
|
|
@ -1,16 +1,16 @@
|
|
|
|
|
/// <reference types="cypress" />
|
|
|
|
|
describe('TicketList', () => {
|
|
|
|
|
const firstRow = 'tbody > :nth-child(1)';
|
|
|
|
|
const firstRow = 'tbody.q-virtual-scroll__content tr:nth-child(1)';
|
|
|
|
|
|
|
|
|
|
beforeEach(() => {
|
|
|
|
|
cy.login('developer');
|
|
|
|
|
cy.viewport(1920, 1080);
|
|
|
|
|
cy.visit('/#/ticket/list');
|
|
|
|
|
cy.domContentLoad();
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
const searchResults = (search) => {
|
|
|
|
|
cy.dataCy('vn-searchbar').find('input').focus();
|
|
|
|
|
if (search) cy.dataCy('vn-searchbar').find('input').type(search);
|
|
|
|
|
if (search) cy.typeSearchbar().type(search);
|
|
|
|
|
cy.dataCy('vn-searchbar').find('input').type('{enter}');
|
|
|
|
|
cy.dataCy('ticketListTable').should('exist');
|
|
|
|
|
cy.get(firstRow).should('exist');
|
|
|
|
@ -27,7 +27,7 @@ describe('TicketList', () => {
|
|
|
|
|
cy.window().then((win) => {
|
|
|
|
|
cy.stub(win, 'open').as('windowOpen');
|
|
|
|
|
});
|
|
|
|
|
cy.get(firstRow).find('.q-btn:first').click();
|
|
|
|
|
cy.get(firstRow).should('be.visible').find('.q-btn:first').click();
|
|
|
|
|
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
@ -38,6 +38,36 @@ describe('TicketList', () => {
|
|
|
|
|
cy.get('.summaryBody').should('exist');
|
|
|
|
|
});
|
|
|
|
|
|
|
|
|
|
it.only('Filter client and create ticket', () => {
|
|
|
|
|
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketSearchbar');
|
|
|
|
|
searchResults();
|
|
|
|
|
cy.wait('@ticketSearchbar').then((interception) => {
|
|
|
|
|
const { query } = interception.request;
|
|
|
|
|
cy.log('Request query:', query);
|
|
|
|
|
expect(query).to.have.property('from');
|
|
|
|
|
expect(query).to.have.property('to');
|
|
|
|
|
expect(query).to.not.have.property('clientFk');
|
|
|
|
|
});
|
|
|
|
|
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
|
|
|
|
cy.get('[data-cy="Customer ID_input"]').clear('1');
|
|
|
|
|
cy.get('[data-cy="Customer ID_input"]').type('1101{enter}');
|
|
|
|
|
cy.wait('@ticketFilter').then((interception) => {
|
|
|
|
|
const { query } = interception.request;
|
|
|
|
|
cy.log('Request query:', query);
|
|
|
|
|
expect(query).to.not.have.property('from');
|
|
|
|
|
expect(query).to.not.have.property('to');
|
|
|
|
|
expect(query).to.have.property('clientFk');
|
|
|
|
|
});
|
|
|
|
|
cy.get('[data-cy="vnTableCreateBtn"] > .q-btn__content > .q-icon').click();
|
|
|
|
|
cy.get('[data-cy="Customer_select"]').should('have.value', 'Bruce Wayne');
|
|
|
|
|
cy.get('[data-cy="Address_select"]').click();
|
|
|
|
|
|
|
|
|
|
cy.selectOptionBeta().click();
|
|
|
|
|
cy.get('[data-cy="Address_select"]').should('have.value', 'Bruce Wayne');
|
|
|
|
|
// cy.get('[role="listbox"] .q-item:nth-child(1)>.q-item__section--avatar > i')
|
|
|
|
|
// .should('have.text', 'star')
|
|
|
|
|
// .click();
|
|
|
|
|
});
|
|
|
|
|
it('Client list create new client', () => {
|
|
|
|
|
cy.dataCy('vnTableCreateBtn').should('exist');
|
|
|
|
|
cy.dataCy('vnTableCreateBtn').click();
|
|
|
|
|