8282-testToMaster #1057
|
@ -737,6 +737,7 @@ function handleSelection({ evt, added, rows: selectedRows }, rows) {
|
||||||
fab
|
fab
|
||||||
icon="add"
|
icon="add"
|
||||||
shortcut="+"
|
shortcut="+"
|
||||||
|
data-testid="vnTableCreateBtn"
|
||||||
/>
|
/>
|
||||||
<QTooltip self="top right">
|
<QTooltip self="top right">
|
||||||
{{ createForm?.title }}
|
{{ createForm?.title }}
|
||||||
|
|
|
@ -130,6 +130,7 @@ async function search() {
|
||||||
dense
|
dense
|
||||||
standout
|
standout
|
||||||
autofocus
|
autofocus
|
||||||
|
data-testid="vnSearchBar"
|
||||||
>
|
>
|
||||||
<template #prepend>
|
<template #prepend>
|
||||||
<QIcon
|
<QIcon
|
||||||
|
|
|
@ -174,7 +174,7 @@ function ticketFilter(ticket) {
|
||||||
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
<QTooltip>{{ t('Client Frozen') }}</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="entity.problem.includes('hasRisk')"
|
v-if="entity?.problem?.includes('hasRisk')"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
size="xs"
|
size="xs"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -99,6 +99,7 @@ function toTicketUrl(section) {
|
||||||
ref="summaryRef"
|
ref="summaryRef"
|
||||||
:url="`Tickets/${entityId}/summary`"
|
:url="`Tickets/${entityId}/summary`"
|
||||||
data-key="TicketSummary"
|
data-key="TicketSummary"
|
||||||
|
data-testid="ticketSummary"
|
||||||
>
|
>
|
||||||
<template #header-left>
|
<template #header-left>
|
||||||
<VnToSummary
|
<VnToSummary
|
||||||
|
|
|
@ -457,6 +457,7 @@ function setReference(data) {
|
||||||
data-key="Ticket"
|
data-key="Ticket"
|
||||||
:label="t('Search ticket')"
|
:label="t('Search ticket')"
|
||||||
:info="t('You can search by ticket id or alias')"
|
:info="t('You can search by ticket id or alias')"
|
||||||
|
data-testid="ticketListSearchBar"
|
||||||
/>
|
/>
|
||||||
<RightMenu>
|
<RightMenu>
|
||||||
<template #right-panel>
|
<template #right-panel>
|
||||||
|
@ -484,6 +485,7 @@ function setReference(data) {
|
||||||
'row-key': 'id',
|
'row-key': 'id',
|
||||||
selection: 'multiple',
|
selection: 'multiple',
|
||||||
}"
|
}"
|
||||||
|
data-testid="ticketListTable"
|
||||||
>
|
>
|
||||||
<template #column-statusIcons="{ row }">
|
<template #column-statusIcons="{ row }">
|
||||||
<div class="q-gutter-x-xs">
|
<div class="q-gutter-x-xs">
|
||||||
|
|
|
@ -0,0 +1,54 @@
|
||||||
|
/// <reference types="cypress" />
|
||||||
|
describe('Ticket descriptor', () => {
|
||||||
|
const firstRow = 'tbody > :nth-child(1)';
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
cy.login('developer');
|
||||||
|
cy.viewport(1920, 1080);
|
||||||
|
cy.visit('/#/ticket/list');
|
||||||
|
});
|
||||||
|
|
||||||
|
const searchResults = (search) => {
|
||||||
|
cy.dataCy('vnSearchBar').find('input').focus();
|
||||||
|
if (search) cy.dataCy('vnSearchBar').find('input').type(search);
|
||||||
|
cy.dataCy('vnSearchBar').find('input').type('{enter}');
|
||||||
|
cy.dataCy('ticketListTable').should('exist');
|
||||||
|
cy.get(firstRow).should('exist');
|
||||||
|
};
|
||||||
|
|
||||||
|
it('should search results', () => {
|
||||||
|
cy.dataCy('ticketListTable').should('not.exist');
|
||||||
|
cy.get('.q-field__control').should('exist');
|
||||||
|
searchResults();
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open ticket sales', () => {
|
||||||
|
searchResults();
|
||||||
|
cy.window().then((win) => {
|
||||||
|
cy.stub(win, 'open').as('windowOpen');
|
||||||
|
});
|
||||||
|
cy.get(firstRow).find('.q-btn:first').click();
|
||||||
|
cy.get('@windowOpen').should('be.calledWithMatch', /\/ticket\/\d+\/sale/);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should open ticket summary', () => {
|
||||||
|
searchResults();
|
||||||
|
cy.get(firstRow).find('.q-btn:last').click();
|
||||||
|
cy.dataCy('ticketSummary').should('exist');
|
||||||
|
});
|
||||||
|
|
||||||
|
it('Client list create new client', () => {
|
||||||
|
cy.dataCy('vnTableCreateBtn').should('exist');
|
||||||
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
const data = {
|
||||||
|
Customer: { val: 1, type: 'select' },
|
||||||
|
Warehouse: { val: 'Warehouse One', type: 'select' },
|
||||||
|
Address: { val: 'employee: employeeLane, CENTRAL CITY', type: 'select' },
|
||||||
|
Landed: { val: '01-01-2024', type: 'date' },
|
||||||
|
};
|
||||||
|
cy.fillInForm(data);
|
||||||
|
cy.get('.q-mt-lg > .q-btn--standard').click();
|
||||||
|
cy.checkNotification('Data created');
|
||||||
|
cy.url().should('match', /\/ticket\/\d+\/summary/);
|
||||||
|
});
|
||||||
|
});
|
|
@ -311,3 +311,7 @@ Cypress.Commands.add('checkValueSelectForm', (id, search) => {
|
||||||
Cypress.Commands.add('searchByLabel', (label, value) => {
|
Cypress.Commands.add('searchByLabel', (label, value) => {
|
||||||
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
|
cy.get(`[label="${label}"] > .q-field > .q-field__inner`).type(`${value}{enter}`);
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Cypress.Commands.add('dataCy', (dataTestId, attr = 'data-testid') => {
|
||||||
|
return cy.get(`[${attr}="${dataTestId}"]`);
|
||||||
|
});
|
||||||
|
|
Loading…
Reference in New Issue