feat: add reserved icon to TicketProblems and update Cypress tests for ticket sale functionality
gitea/salix-front/pipeline/pr-test This commit looks good
Details
gitea/salix-front/pipeline/pr-test This commit looks good
Details
This commit is contained in:
parent
6fb160ec8d
commit
399437d334
|
@ -17,6 +17,17 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</router-link>
|
</router-link>
|
||||||
|
<QIcon
|
||||||
|
v-if="row?.reserved"
|
||||||
|
color="primary"
|
||||||
|
name="vn:reserva"
|
||||||
|
size="xs"
|
||||||
|
data-cy="ticketSaleReservedIcon"
|
||||||
|
>
|
||||||
|
<QTooltip>
|
||||||
|
{{ t('ticketSale.reserved') }}
|
||||||
|
</QTooltip>
|
||||||
|
</QIcon>
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row?.risk"
|
v-if="row?.risk"
|
||||||
name="vn:risk"
|
name="vn:risk"
|
||||||
|
|
|
@ -681,7 +681,6 @@ watch(
|
||||||
:disabled-attr="isTicketEditable"
|
:disabled-attr="isTicketEditable"
|
||||||
>
|
>
|
||||||
<template #column-statusIcons="{ row }">
|
<template #column-statusIcons="{ row }">
|
||||||
<QIcon name="vn:reserved" v-if="row.reserved"></QIcon>
|
|
||||||
<TicketProblems :row="row" />
|
<TicketProblems :row="row" />
|
||||||
</template>
|
</template>
|
||||||
<template #body-cell-picture="{ row }">
|
<template #body-cell-picture="{ row }">
|
||||||
|
|
|
@ -9,43 +9,8 @@ describe('TicketFilter', () => {
|
||||||
|
|
||||||
it('use search button', function () {
|
it('use search button', function () {
|
||||||
cy.waitForElement('.q-page');
|
cy.waitForElement('.q-page');
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
cy.get('[data-cy="Customer ID_input"]').type('1105');
|
||||||
cy.searchBtnFilterPanel();
|
cy.searchBtnFilterPanel();
|
||||||
cy.waitRequest('@ticketFilter', ({ request }) => {
|
cy.location('href').should('contain', '#/ticket/15/summary');
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.have.property('from');
|
|
||||||
expect(query).to.have.property('to');
|
|
||||||
});
|
|
||||||
cy.on('uncaught:exception', () => {
|
|
||||||
return false;
|
|
||||||
});
|
|
||||||
cy.get('.q-field__control-container > [data-cy="From_date"]')
|
|
||||||
.type(`${today()} `)
|
|
||||||
.type('{enter}');
|
|
||||||
cy.get('.q-notification').should(
|
|
||||||
'contain',
|
|
||||||
`The date range must have both 'from' and 'to'`,
|
|
||||||
);
|
|
||||||
|
|
||||||
cy.get('.q-field__control-container > [data-cy="To_date"]').type(
|
|
||||||
`${today()}{enter}`,
|
|
||||||
);
|
|
||||||
cy.intercept('GET', /\/api\/Tickets\/filter/).as('ticketFilter');
|
|
||||||
cy.searchBtnFilterPanel();
|
|
||||||
cy.wait('@ticketFilter').then(({ request }) => {
|
|
||||||
const { query } = request;
|
|
||||||
expect(query).to.have.property('from');
|
|
||||||
expect(query).to.have.property('to');
|
|
||||||
});
|
|
||||||
cy.location('href').should('contain', '#/ticket/999999');
|
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
function today(date) {
|
|
||||||
// return new Date().toISOString().split('T')[0];
|
|
||||||
|
|
||||||
return new Intl.DateTimeFormat('es-ES', {
|
|
||||||
day: '2-digit',
|
|
||||||
month: '2-digit',
|
|
||||||
year: 'numeric',
|
|
||||||
}).format(date ?? new Date());
|
|
||||||
}
|
|
||||||
|
|
|
@ -138,7 +138,7 @@ describe('TicketSale', () => {
|
||||||
it('update price', () => {
|
it('update price', () => {
|
||||||
const price = Number((Math.random() * 99 + 1).toFixed(2));
|
const price = Number((Math.random() * 99 + 1).toFixed(2));
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.get(':nth-child(10) > .q-btn').click();
|
cy.get('[data-col-field="price"]').find('.q-btn').click();
|
||||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||||
cy.waitForElement('[data-cy="Price_input"]');
|
cy.waitForElement('[data-cy="Price_input"]');
|
||||||
|
@ -147,15 +147,14 @@ describe('TicketSale', () => {
|
||||||
cy.dataCy('saveManaBtn').click();
|
cy.dataCy('saveManaBtn').click();
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(10) > .q-btn > .q-btn__content').should(
|
cy.get('[data-col-field="price"]')
|
||||||
'have.text',
|
.find('.q-btn > .q-btn__content')
|
||||||
`€${price}`,
|
.should('have.text', `€${price}`);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
it('update dicount', () => {
|
it('update discount', () => {
|
||||||
const discount = Math.floor(Math.random() * 100) + 1;
|
const discount = Math.floor(Math.random() * 100) + 1;
|
||||||
selectFirstRow();
|
selectFirstRow();
|
||||||
cy.get(':nth-child(11) > .q-btn').click();
|
cy.get('[data-col-field="discount"]').find('.q-btn').click();
|
||||||
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
cy.waitForElement('[data-cy="ticketEditManaProxy"]');
|
||||||
cy.dataCy('ticketEditManaProxy').should('exist');
|
cy.dataCy('ticketEditManaProxy').should('exist');
|
||||||
cy.waitForElement('[data-cy="Disc_input"]');
|
cy.waitForElement('[data-cy="Disc_input"]');
|
||||||
|
@ -164,26 +163,24 @@ describe('TicketSale', () => {
|
||||||
cy.dataCy('saveManaBtn').click();
|
cy.dataCy('saveManaBtn').click();
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(11) > .q-btn > .q-btn__content').should(
|
cy.get('[data-col-field="discount"]')
|
||||||
'have.text',
|
.find('.q-btn > .q-btn__content')
|
||||||
`${discount}.00%`,
|
.should('have.text', `${discount}.00%`);
|
||||||
);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
it('change concept', () => {
|
it.only('change concept', () => {
|
||||||
const quantity = Math.floor(Math.random() * 100) + 1;
|
const concept = Math.floor(Math.random() * 100) + 1;
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.get(':nth-child(8) > .row').click();
|
cy.get('[data-col-field="item"]').click();
|
||||||
cy.get(
|
cy.get('.q-menu')
|
||||||
'.q-menu > [data-v-ca3f07a4=""] > .q-field > .q-field__inner > .q-field__control > .q-field__control-container > [data-cy="undefined_input"]',
|
.find('[data-cy="undefined_input"]')
|
||||||
)
|
.type(concept)
|
||||||
.type(quantity)
|
|
||||||
.type('{enter}');
|
.type('{enter}');
|
||||||
handleVnConfirm();
|
handleVnConfirm();
|
||||||
|
|
||||||
cy.get(':nth-child(8) >.row').should('contain.text', `${quantity}`);
|
cy.get('[data-col-field="item"]').should('contain.text', `${concept}`);
|
||||||
});
|
});
|
||||||
it('changequantity ', () => {
|
it('change quantity ', () => {
|
||||||
const quantity = Math.floor(Math.random() * 100) + 1;
|
const quantity = Math.floor(Math.random() * 100) + 1;
|
||||||
cy.waitForElement(firstRow);
|
cy.waitForElement(firstRow);
|
||||||
cy.dataCy('ticketSaleQuantityInput').clear();
|
cy.dataCy('ticketSaleQuantityInput').clear();
|
||||||
|
@ -200,7 +197,7 @@ describe('TicketSale', () => {
|
||||||
});
|
});
|
||||||
|
|
||||||
function handleVnConfirm() {
|
function handleVnConfirm() {
|
||||||
cy.get('[data-cy="VnConfirm_confirm"] > .q-btn__content > .block').click();
|
cy.get('[data-cy="VnConfirm_confirm"]').click();
|
||||||
cy.waitForElement('.q-notification__message');
|
cy.waitForElement('.q-notification__message');
|
||||||
|
|
||||||
cy.get('.q-notification__message').should('be.visible');
|
cy.get('.q-notification__message').should('be.visible');
|
||||||
|
|
Loading…
Reference in New Issue