#8442 - createVehicleDms #1614
|
@ -81,12 +81,16 @@ function getUrl() {
|
|||
}
|
||||
|
||||
async function save() {
|
||||
const body = mapperDms(dms.value);
|
||||
const response = await axios.post(getUrl(), body[0], body[1]);
|
||||
emit('onDataSaved', body[1].params, response);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
delete dms.value.files;
|
||||
return response;
|
||||
try {
|
||||
const body = mapperDms(dms.value);
|
||||
const response = await axios.post(getUrl(), body[0], body[1]);
|
||||
emit('onDataSaved', body[1].params, response);
|
||||
notify(t('globals.dataSaved'), 'positive');
|
||||
delete dms.value.files;
|
||||
return response;
|
||||
} catch (e) {
|
||||
throw new Error(e.message);
|
||||
jtubau marked this conversation as resolved
Outdated
|
||||
}
|
||||
}
|
||||
|
||||
function defaultData() {
|
||||
jtubau marked this conversation as resolved
Outdated
jorgep
commented
No puedes usar throw e y ya está? No puedes usar throw e y ya está?
|
||||
|
|
|
@ -43,7 +43,6 @@ const importDms = async () => {
|
|||
@on-fetch="(data) => (dmsOptions = data)"
|
||||
/>
|
||||
<FormModelPopup
|
||||
url-create="genera"
|
||||
model="DmsImport"
|
||||
:title="t('vehicle.dms.selectDocId')"
|
||||
:form-initial-data="{}"
|
||||
|
|
|
@ -11,18 +11,16 @@ describe('Vehicle DMS', () => {
|
|||
'tr:first-child > :nth-child(5) > .q-tr > :nth-child(1) > span',
|
||||
firstRowId: 'tr:first-child > :nth-child(2) > .q-tr > :nth-child(1) > span',
|
||||
lastRowWorkerLink: 'tr:last-child > :nth-child(8) > .q-tr > .link',
|
||||
workerDescriptorPopupTitle:
|
||||
'.q-menu > .descriptor > .body > .q-list > .q-item__label--header > .title > span',
|
||||
workerDescriptorGoToSummary:
|
||||
'[href="#/worker/5/summary"] > .q-btn > .q-btn__content > .q-icon',
|
||||
summaryTitle: '.summaryHeader > div',
|
||||
descriptorTitle: '.descriptor .title',
|
||||
descriptorGoToSummaryBtn: '.descriptor [data-cy="goToSummaryBtn"]',
|
||||
summaryTitle: '.summaryHeader',
|
||||
referenceInput: 'Reference_input',
|
||||
companySelect: 'Company_select',
|
||||
warehouseSelect: 'Warehouse_select',
|
||||
typeSelect: 'Type_select',
|
||||
fileInput: 'VnDms_inputFile',
|
||||
importBtn: 'importBtn',
|
||||
addBtn: 'addDmsBtn',
|
||||
addBtn: 'addButton',
|
||||
saveFormBtn: 'FormModelPopup_save',
|
||||
};
|
||||
|
||||
|
@ -103,8 +101,8 @@ describe('Vehicle DMS', () => {
|
|||
|
||||
jtubau marked this conversation as resolved
Outdated
jorgep
commented
Lo mismo que los popup del otro archivo de tests Lo mismo que los popup del otro archivo de tests
|
||||
it('Should redirect to worker summary from worker descriptor pop-up', () => {
|
||||
cy.get(selectors.lastRowWorkerLink).click();
|
||||
cy.get(selectors.workerDescriptorPopupTitle).should('contain', 'administrative');
|
||||
cy.get(selectors.workerDescriptorGoToSummary).click();
|
||||
cy.get(selectors.summaryTitle).should('contain', 'administrative');
|
||||
cy.get(selectors.descriptorTitle).should('contain', 'administrative');
|
||||
cy.get(selectors.descriptorGoToSummaryBtn).click();
|
||||
cy.containContent(selectors.summaryTitle, 'administrative');
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Muestra notificación al usuario correctamente no?