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
gitea/salix-front/pipeline/pr-dev There was a failure building this commit
Details
This commit is contained in:
parent
31e337c77b
commit
7d62f7161b
|
@ -141,16 +141,6 @@ const formatDate = () => {
|
||||||
textColor.value = '';
|
textColor.value = '';
|
||||||
};
|
};
|
||||||
|
|
||||||
const didFormat = ref(false);
|
|
||||||
|
|
||||||
const handleBlurOrFocusout = (e) => {
|
|
||||||
if (!didFormat.value) {
|
|
||||||
formatDate();
|
|
||||||
didFormat.value = true;
|
|
||||||
nextTick(() => (didFormat.value = false));
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleEnter = (event) => {
|
const handleEnter = (event) => {
|
||||||
formatDate();
|
formatDate();
|
||||||
|
|
||||||
|
@ -180,8 +170,7 @@ const handleEnter = (event) => {
|
||||||
:input-style="{ color: textColor }"
|
:input-style="{ color: textColor }"
|
||||||
@click="isPopupOpen = !isPopupOpen"
|
@click="isPopupOpen = !isPopupOpen"
|
||||||
@keydown="isPopupOpen = false"
|
@keydown="isPopupOpen = false"
|
||||||
@blur="handleBlurOrFocusout"
|
@focusout="formatDate"
|
||||||
@focusout="handleBlurOrFocusout"
|
|
||||||
@keydown.enter.prevent="handleEnter"
|
@keydown.enter.prevent="handleEnter"
|
||||||
hide-bottom-space
|
hide-bottom-space
|
||||||
:data-cy="($attrs['data-cy'] ?? $attrs.label) + '_inputDate'"
|
:data-cy="($attrs['data-cy'] ?? $attrs.label) + '_inputDate'"
|
||||||
|
|
|
@ -190,7 +190,7 @@ const vehicleCard = {
|
||||||
path: 'invoice-in',
|
path: 'invoice-in',
|
||||||
meta: {
|
meta: {
|
||||||
title: 'invoiceIns',
|
title: 'invoiceIns',
|
||||||
icon: 'vn:ticket',
|
icon: 'vn:invoice-in',
|
||||||
},
|
},
|
||||||
component: () => import('src/pages/Route/Vehicle/Card/VehicleInvoiceIn.vue'),
|
component: () => import('src/pages/Route/Vehicle/Card/VehicleInvoiceIn.vue'),
|
||||||
},
|
},
|
||||||
|
|
|
@ -23,8 +23,8 @@ describe('Route extended list', () => {
|
||||||
searchbar: 'searchbar',
|
searchbar: 'searchbar',
|
||||||
firstTicketsRowSelectCheckBox:
|
firstTicketsRowSelectCheckBox:
|
||||||
'.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
|
'.q-card .q-table > tbody > :nth-child(1) .q-checkbox',
|
||||||
openSummaryBtn: 'tableAction-1',
|
tableActionOpen: 'tableAction-1',
|
||||||
goToSummaryBtn: 'tableAction-2',
|
tableActionRedirect: 'tableAction-2',
|
||||||
summaryGoToSummaryBtn: '[data-cy="goToSummaryBtn"]',
|
summaryGoToSummaryBtn: '[data-cy="goToSummaryBtn"]',
|
||||||
descriptorSubtitle: '[data-cy="vnDescriptor_subtitle"]',
|
descriptorSubtitle: '[data-cy="vnDescriptor_subtitle"]',
|
||||||
hideRightMenu: 'toggle-right-drawer',
|
hideRightMenu: 'toggle-right-drawer',
|
||||||
|
@ -75,7 +75,7 @@ describe('Route extended list', () => {
|
||||||
.type(`{selectall}{backspace}${value}`);
|
.type(`{selectall}{backspace}${value}`);
|
||||||
break;
|
break;
|
||||||
case 'checkbox':
|
case 'checkbox':
|
||||||
cy.get(selector).should('be.visible').click()
|
cy.get(selector).should('be.visible').click();
|
||||||
cy.get(selector).click();
|
cy.get(selector).click();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -190,7 +190,7 @@ describe('Route extended list', () => {
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((routeId) => {
|
.then((routeId) => {
|
||||||
routeId = routeId.trim();
|
routeId = routeId.trim();
|
||||||
cy.dataCy(selectors.openSummaryBtn).last().click();
|
cy.dataCy(selectors.tableActionOpen).last().click();
|
||||||
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
|
cy.get(selectors.summaryGoToSummaryBtn).should('be.visible').click();
|
||||||
cy.location().should('match', summaryUrlRegex);
|
cy.location().should('match', summaryUrlRegex);
|
||||||
cy.containContent(selectors.descriptorSubtitle, routeId);
|
cy.containContent(selectors.descriptorSubtitle, routeId);
|
||||||
|
@ -203,7 +203,7 @@ describe('Route extended list', () => {
|
||||||
.invoke('text')
|
.invoke('text')
|
||||||
.then((routeId) => {
|
.then((routeId) => {
|
||||||
routeId = routeId.trim();
|
routeId = routeId.trim();
|
||||||
cy.dataCy(selectors.goToSummaryBtn).last().click();
|
cy.dataCy(selectors.tableActionRedirect).last().click();
|
||||||
cy.location().should('match', summaryUrlRegex);
|
cy.location().should('match', summaryUrlRegex);
|
||||||
cy.containContent(selectors.descriptorSubtitle, routeId);
|
cy.containContent(selectors.descriptorSubtitle, routeId);
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue