7383-testToMaster #370

Merged
alexm merged 365 commits from 7383-testToMaster into master 2024-05-14 05:46:56 +00:00
5 changed files with 51 additions and 38 deletions
Showing only changes of commit d490d85ecc - Show all commits

View File

@ -1177,6 +1177,9 @@ agency:
removeItemError: Error al eliminar la agencia removeItemError: Error al eliminar la agencia
pageTitles: pageTitles:
agency: Agencia agency: Agencia
searchBar:
info: Puedes buscar por nombre o id
label: Buscar agencia...
components: components:
topbar: {} topbar: {}
itemsFilterPanel: itemsFilterPanel:

View File

@ -6,7 +6,6 @@ import { useI18n } from 'vue-i18n';
import FormModel from 'components/FormModel.vue'; import FormModel from 'components/FormModel.vue';
import FetchData from 'src/components/FetchData.vue'; import FetchData from 'src/components/FetchData.vue';
import VnRow from 'components/ui/VnRow.vue'; import VnRow from 'components/ui/VnRow.vue';
import VnSubToolbar from 'src/components/ui/VnSubToolbar.vue';
import VnInput from 'src/components/common/VnInput.vue'; import VnInput from 'src/components/common/VnInput.vue';
import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; import VnSelectFilter from 'src/components/common/VnSelectFilter.vue';
@ -22,7 +21,6 @@ const warehouses = ref([]);
@on-fetch="(data) => (warehouses = data)" @on-fetch="(data) => (warehouses = data)"
auto-load auto-load
/> />
<VnSubToolbar />
<FormModel :url="`Agencies/${routeId}`" model="agency" auto-load> <FormModel :url="`Agencies/${routeId}`" model="agency" auto-load>
<template #form="{ data }"> <template #form="{ data }">
<VnRow> <VnRow>

View File

@ -1,17 +1,12 @@
<script setup> <script setup>
import { onMounted, watch } from 'vue'; import { onMounted, watch } from 'vue';
import { useRoute } from 'vue-router'; import { useRoute } from 'vue-router';
import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import { useArrayData } from 'src/composables/useArrayData'; import { useArrayData } from 'src/composables/useArrayData';
import LeftMenu from 'components/LeftMenu.vue';
import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
import AgencyDescriptor from 'pages/Agency/Card/AgencyDescriptor.vue'; import AgencyDescriptor from 'pages/Agency/Card/AgencyDescriptor.vue';
import VnCard from 'components/common/VnCard.vue';
const { t } = useI18n();
const route = useRoute(); const route = useRoute();
const stateStore = useStateStore();
const arrayData = useArrayData('Agency', { const arrayData = useArrayData('Agency', {
url: `Agencies/${route.params.id}`, url: `Agencies/${route.params.id}`,
}); });
@ -28,23 +23,13 @@ watch(
); );
</script> </script>
<template> <template>
<Teleport to="#searchbar" v-if="stateStore.isHeaderMounted()"> <VnCard
<VnSearchbar data-key="Agency"
:info="t('Agency.searchBar.info')" base-url="Agencies"
:label="t('Agency.searchBar.label')" :descriptor="AgencyDescriptor"
data-key="AgencyList" searchbar-data-key="AgencyList"
/> searchbar-url="Agencies"
</Teleport> searchbar-label="agency.searchBar.label"
<QDrawer v-model="stateStore.leftDrawer" show-if-above :width="256"> searchbar-info="agency.searchBar.info"
<QScrollArea class="fit"> />
<AgencyDescriptor />
<QSeparator />
<LeftMenu source="card" />
</QScrollArea>
</QDrawer>
<QPageContainer>
<QPage>
<RouterView></RouterView>
</QPage>
</QPageContainer>
</template> </template>

View File

@ -133,6 +133,7 @@ async function deleteWorCenter(id) {
isAnyVolumeAllowed: Permite cualquier volumen isAnyVolumeAllowed: Permite cualquier volumen
Search agency: Buscar agencia Search agency: Buscar agencia
You can search by name: Puedes buscar por nombre You can search by name: Puedes buscar por nombre
This workCenter is already assigned to this agency: Este workCenter ya está asignado a esta agencia
en: en:
isOwn: Has owner isOwn: Has owner
isAnyVolumeAllowed: Allows any volume isAnyVolumeAllowed: Allows any volume

View File

@ -1,25 +1,51 @@
describe('template spec', () => { describe('template spec', () => {
const agencyId = 11;
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
cy.visit(`/#/agency`); cy.visit(`/#/agency`);
}); });
it('passes', () => { it('assign workCenter', () => {
cy.visit(`/#/agency`); cy.visit(`/#/agency`);
/* ==== Generated with Cypress Studio ==== */
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click(); cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/1/workCenter"] > .q-item__section--main').click(); cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get('#f_fa5833a2-f919-4542-b663-e72b3ba4ffe5').click(); cy.get(
cy.get('#f_fa5833a2-f919-4542-b663-e72b3ba4ffe5_0').click(); '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
cy.get('#formModel > .q-card').click(); ).type('workCenterOne{enter}');
cy.get('.q-btn--standard > .q-btn__content > .block').click(); cy.get('.q-btn--standard > .q-btn__content > .block').click();
cy.get('.q-notification__message').should('have.text', 'Data created');
});
it('delete workCenter', () => {
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-item__section--side > .q-btn > .q-btn__content > .q-icon').click();
cy.get('.q-notification__message').should(
'have.text',
'Agency removed successfully'
);
});
it('error on duplicate workCenter', () => {
cy.visit(`/#/agency`);
cy.get(':nth-child(1) > :nth-child(1) > .card-list-body > .list-items').click();
cy.get('[href="#/agency/11/workCenter"] > .q-item__section--main').click();
cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click(); cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get('#f_94743509-f7a7-4e5c-83f4-61ab52c7cd72').click(); cy.get(
cy.get('#f_94743509-f7a7-4e5c-83f4-61ab52c7cd72_1 > .q-item__section').click(); '.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
cy.get('.q-btn--standard > .q-btn__content > .block').click(); cy.get('.q-btn--standard > .q-btn__content > .block').click();
cy.get('.q-btn--flat > .q-btn__content > .block').; cy.get('.q-notification__message').should('have.text', 'Data created');
/* ==== End Cypress Studio ==== */ cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
cy.get(
'.vn-row > .q-field > .q-field__inner > .q-field__control > .q-field__control-container'
).type('workCenterOne{enter}');
cy.get('.q-btn--standard > .q-btn__content > .block').click();
cy.get(
':nth-child(2) > .q-notification__wrapper > .q-notification__content > .q-notification__message'
).should('have.text', 'This workCenter is already assigned to this agency');
}); });
}); });