salix-front/test/cypress/integration/ticket/negative/TicketLackDetail.spec.js

88 lines
3.3 KiB
JavaScript

/// <reference types="cypress" />
describe('Ticket Lack detail', () => {
beforeEach(() => {
const ticketId = 1;
cy.login('developer');
cy.intercept('GET', /\/api\/Tickets\/itemLack\/5.*$/, {
statusCode: 200,
body: [
{
saleFk: 33,
code: 'OK',
ticketFk: 142,
nickname: 'Malibu Point',
shipped: '2000-12-31T23:00:00.000Z',
hour: 0,
quantity: 50,
agName: 'Super-Man delivery',
alertLevel: 0,
stateName: 'OK',
stateId: 3,
itemFk: 5,
price: 1.79,
alertLevelCode: 'FREE',
zoneFk: 9,
zoneName: 'Zone superMan',
theoreticalhour: '2011-11-01T22:59:00.000Z',
isRookie: 1,
turno: 1,
peticionCompra: 1,
hasSubstitution: 1,
hasToIgnore: 1,
isBasket: 1,
minTimed: 0,
customerId: 1104,
customerName: 'Tony Stark',
observationTypeCode: 'administrative',
},
],
}).as('getItemLack'); // and assign an alias
cy.visit('/#/ticket/negative/5');
});
describe('Table actions', () => {
it('should display only one row in the lack list', () => {
cy.visit('/#/ticket/negative/5');
cy.wait('@getItemLack');
cy.location('href').should('contain', '#/ticket/negative/5');
cy.get('[data-cy="changeItem"]').should('be.disabled');
cy.get('[data-cy="changeState"]').should('be.disabled');
cy.get('[data-cy="changeQuantity"]').should('be.disabled');
cy.get('[data-cy="itemProposal"]').should('be.disabled');
cy.get('[data-cy="transferLines"]').should('be.disabled');
// WIP
// cy.get('[data-cy="showFree"] > .q-checkbox__inner').should('be.checked');
cy.get('tr.cursor-pointer > :nth-child(1)').click();
cy.get('[data-cy="changeItem"]').should('be.enabled');
cy.get('[data-cy="changeState"]').should('be.enabled');
cy.get('[data-cy="changeQuantity"]').should('be.enabled');
cy.get('[data-cy="itemProposal"]').should('be.enabled');
cy.get('[data-cy="transferLines"]').should('be.enabled');
});
});
describe('Update quantity', () => {
it('Update from popover', () => {});
it('Update from table', () => {});
});
describe('Update state', () => {
it('Update from popover', () => {});
it('Update from table', () => {});
});
describe('Ticket transfer', () => {
describe('Split ticket if ', () => {
it('Ticket has less or equal than 1 row', () => {});
it('Ticket has more than 1 row', () => {});
});
});
describe('Item proposal', () => {
describe('Replace item if', () => {
it('Quantity is less than available', () => {});
it('Quantity is equal than available', () => {});
it('Quantity is more than available', () => {});
});
});
});