refactor: refs #8441 update date input handling and rename action selectors in route tests
gitea/salix-front/pipeline/pr-dev There was a failure building this commit Details

This commit is contained in:
Jose Antonio Tubau 2025-04-23 07:30:58 +02:00
parent 31e337c77b
commit 7d62f7161b
3 changed files with 7 additions and 18 deletions

View File

@ -141,16 +141,6 @@ const formatDate = () => {
textColor.value = '';
};
const didFormat = ref(false);
const handleBlurOrFocusout = (e) => {
if (!didFormat.value) {
formatDate();
didFormat.value = true;
nextTick(() => (didFormat.value = false));
}
};
const handleEnter = (event) => {
formatDate();
@ -180,8 +170,7 @@ const handleEnter = (event) => {
:input-style="{ color: textColor }"
@click="isPopupOpen = !isPopupOpen"
@keydown="isPopupOpen = false"
@blur="handleBlurOrFocusout"
@focusout="handleBlurOrFocusout"
@focusout="formatDate"
@keydown.enter.prevent="handleEnter"
hide-bottom-space
:data-cy="($attrs['data-cy'] ?? $attrs.label) + '_inputDate'"

View File

@ -190,7 +190,7 @@ const vehicleCard = {
path: 'invoice-in',
meta: {
title: 'invoiceIns',
icon: 'vn:ticket',
icon: 'vn:invoice-in',
},
component: () => import('src/pages/Route/Vehicle/Card/VehicleInvoiceIn.vue'),
},

View File

@ -23,8 +23,8 @@ describe('Route extended list', () => {
searchbar: 'searchbar',
firstTicketsRowSelectCheckBox:
'.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
openSummaryBtn: 'tableAction-1',
goToSummaryBtn: 'tableAction-2',
tableActionOpen: 'tableAction-1',
tableActionRedirect: 'tableAction-2',
summaryGoToSummaryBtn: '[data-cy="goToSummaryBtn"]',
descriptorSubtitle: '[data-cy="vnDescriptor_subtitle"]',
hideRightMenu: 'toggle-right-drawer',
@ -75,7 +75,7 @@ describe('Route extended list', () => {
.type(`{selectall}{backspace}${value}`);
break;
case 'checkbox':
cy.get(selector).should('be.visible').click()
cy.get(selector).should('be.visible').click();
cy.get(selector).click();
break;
}
@ -190,7 +190,7 @@ describe('Route extended list', () => {
.invoke('text')
.then((routeId) => {
routeId = routeId.trim();
cy.dataCy(selectors.openSummaryBtn).last().click();
cy.dataCy(selectors.tableActionOpen).last().click();
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
cy.location().should('match', summaryUrlRegex);
cy.containContent(selectors.descriptorSubtitle, routeId);
@ -203,7 +203,7 @@ describe('Route extended list', () => {
.invoke('text')
.then((routeId) => {
routeId = routeId.trim();
cy.dataCy(selectors.goToSummaryBtn).last().click();
cy.dataCy(selectors.tableActionRedirect).last().click();
cy.location().should('match', summaryUrlRegex);
cy.containContent(selectors.descriptorSubtitle, routeId);
});