feat: refs #6242 added e2e to verify the icons shown
This commit is contained in:
parent
264881274d
commit
b55ddf4cec
|
@ -119,7 +119,7 @@ const setData = (entity) => {
|
||||||
<FetchData
|
<FetchData
|
||||||
:url="`Tickets/${entityId}/getTicketProblems`"
|
:url="`Tickets/${entityId}/getTicketProblems`"
|
||||||
auto-load
|
auto-load
|
||||||
@on-fetch="(data) => (problems = data)"
|
@on-fetch="(data) => ([problems] = data)"
|
||||||
/>
|
/>
|
||||||
<CardDescriptor
|
<CardDescriptor
|
||||||
module="Ticket"
|
module="Ticket"
|
||||||
|
@ -177,7 +177,7 @@ const setData = (entity) => {
|
||||||
</template>
|
</template>
|
||||||
<template #icons>
|
<template #icons>
|
||||||
<QCardActions class="q-gutter-x-xs">
|
<QCardActions class="q-gutter-x-xs">
|
||||||
<TicketProblems :row="problems[0]" />
|
<TicketProblems :row="problems" />
|
||||||
</QCardActions>
|
</QCardActions>
|
||||||
</template>
|
</template>
|
||||||
<template #actions="{ entity }">
|
<template #actions="{ entity }">
|
||||||
|
|
|
@ -53,4 +53,29 @@ describe('TicketList', () => {
|
||||||
cy.checkNotification('Data created');
|
cy.checkNotification('Data created');
|
||||||
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should show the corerct problems', () => {
|
||||||
|
cy.intercept('GET', '**/api/Tickets/filter*', (req) => {
|
||||||
|
req.headers['cache-control'] = 'no-cache';
|
||||||
|
req.headers['pragma'] = 'no-cache';
|
||||||
|
req.headers['expires'] = '0';
|
||||||
|
|
||||||
|
req.on('response', (res) => {
|
||||||
|
delete res.headers['if-none-match'];
|
||||||
|
delete res.headers['if-modified-since'];
|
||||||
|
});
|
||||||
|
}).as('ticket');
|
||||||
|
|
||||||
|
cy.get('[data-cy="Warehouse_select"]').type('Warehouse Five');
|
||||||
|
cy.get('.q-menu .q-item').contains('Warehouse Five').click();
|
||||||
|
cy.wait('@ticket').then((interception) => {
|
||||||
|
const data = interception.response.body[1];
|
||||||
|
expect(data.hasComponentLack).to.equal(1);
|
||||||
|
expect(data.isTooLittle).to.equal(1);
|
||||||
|
expect(data.hasItemShortage).to.equal(1);
|
||||||
|
});
|
||||||
|
cy.get('.icon-components').should('exist');
|
||||||
|
cy.get('.icon-unavailable').should('exist');
|
||||||
|
cy.get('.icon-isTooLittle').should('exist');
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue