diff --git a/src/components/CreateBankEntityForm.vue b/src/components/CreateBankEntityForm.vue index 2d098beb0..4acc7b749 100644 --- a/src/components/CreateBankEntityForm.vue +++ b/src/components/CreateBankEntityForm.vue @@ -3,7 +3,7 @@ import { reactive, ref, onMounted, nextTick } from 'vue'; import { useI18n } from 'vue-i18n'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'components/FetchData.vue'; import VnRow from 'components/ui/VnRow.vue'; import FormModelPopup from './FormModelPopup.vue'; @@ -78,7 +78,7 @@ onMounted(async () => {
- {
- { - +
{{ t('Or') }}
- {
- { />
- { />
- {
- { />
- {
- {
- { />
- {
- { {{ ` ${rows.length} ` }} {{ t('buy(s)') }} - { />
- { />
- { />
- {

{{ t('Filter travels') }}

- { />
- { />
- diff --git a/src/components/ItemsFilterPanel.vue b/src/components/ItemsFilterPanel.vue index f7f07a5b0..94adfe0ff 100644 --- a/src/components/ItemsFilterPanel.vue +++ b/src/components/ItemsFilterPanel.vue @@ -5,7 +5,7 @@ import { useI18n } from 'vue-i18n'; import VnInput from 'components/common/VnInput.vue'; import FetchData from 'components/FetchData.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnFilterPanelChip from 'components/ui/VnFilterPanelChip.vue'; import axios from 'axios'; @@ -207,7 +207,7 @@ const removeTag = (index, params, search) => { - { - + @@ -246,7 +246,7 @@ const removeTag = (index, params, search) => { class="q-mt-md filter-value" > - { /> - {
- { - +
- {
- { - +
-
- - + > + + - - - - - - - - - + diff --git a/src/components/common/VnSelectFilter.vue b/src/components/common/VnSelect.vue similarity index 100% rename from src/components/common/VnSelectFilter.vue rename to src/components/common/VnSelect.vue diff --git a/src/components/common/VnSelectDialog.vue b/src/components/common/VnSelectDialog.vue index 95d6a44fe..3726691af 100644 --- a/src/components/common/VnSelectDialog.vue +++ b/src/components/common/VnSelectDialog.vue @@ -1,7 +1,7 @@ - + - { />
-
-
- - - - - - - - { - { - { - { - { - { - { - { - - -
- -
-
-
- { - console.log(data.credit); initialData.value.credit = data.credit; }; diff --git a/src/pages/Customer/components/CustomerFileManagementCreate.vue b/src/pages/Customer/components/CustomerFileManagementCreate.vue index 8970eaaaf..bc218d1b2 100644 --- a/src/pages/Customer/components/CustomerFileManagementCreate.vue +++ b/src/pages/Customer/components/CustomerFileManagementCreate.vue @@ -11,7 +11,7 @@ import useNotify from 'src/composables/useNotify'; import FetchData from 'components/FetchData.vue'; import VnRow from 'components/ui/VnRow.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import VnInput from 'src/components/common/VnInput.vue'; const { notify } = useNotify(); @@ -152,7 +152,7 @@ const toCustomerFileManagement = () => { />
- {
- { />
- { />
- {
- { />
- {
- { />
- {
- { - +
{
- { v-if="sampleType?.hasCompany || sampleType?.datepickerEnabled" >
- { />
- { {{ t('Edit address') }} - +
diff --git a/src/pages/Department/Card/DepartmentBasicData.vue b/src/pages/Department/Card/DepartmentBasicData.vue index 3b30a97e6..4210a62bc 100644 --- a/src/pages/Department/Card/DepartmentBasicData.vue +++ b/src/pages/Department/Card/DepartmentBasicData.vue @@ -7,7 +7,7 @@ import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; import VnRow from 'components/ui/VnRow.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; const route = useRoute(); const { t } = useI18n(); @@ -68,7 +68,7 @@ const clientsOptions = ref([]);
-
- { - +
{ />
- {
- ({ event: getInputEvents, }, packagingFk: { - component: VnSelectFilter, + component: VnSelect, props: { 'option-value': 'id', 'option-label': 'id', diff --git a/src/pages/Entry/Card/EntryBuysImport.vue b/src/pages/Entry/Card/EntryBuysImport.vue index bd09eabe8..705f56b68 100644 --- a/src/pages/Entry/Card/EntryBuysImport.vue +++ b/src/pages/Entry/Card/EntryBuysImport.vue @@ -6,7 +6,7 @@ import { useI18n } from 'vue-i18n'; import VnInput from 'src/components/common/VnInput.vue'; import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'components/FetchData.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnSelectDialog from 'src/components/common/VnSelectDialog.vue'; import FilterItemForm from 'src/components/FilterItemForm.vue'; @@ -269,7 +269,7 @@ const redirectToBuysView = () => { - + diff --git a/src/pages/Entry/EntryLatestBuys.vue b/src/pages/Entry/EntryLatestBuys.vue index 78f578686..c3e83c96f 100644 --- a/src/pages/Entry/EntryLatestBuys.vue +++ b/src/pages/Entry/EntryLatestBuys.vue @@ -9,7 +9,7 @@ import EntryDescriptorProxy from './Card/EntryDescriptorProxy.vue'; import TableVisibleColumns from 'src/components/common/TableVisibleColumns.vue'; import EditTableCellValueForm from 'src/components/EditTableCellValueForm.vue'; import VnInput from 'src/components/common/VnInput.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import EntryLatestBuysFilter from './EntryLatestBuysFilter.vue'; import ItemDescriptorProxy from '../Item/Card/ItemDescriptorProxy.vue'; @@ -218,7 +218,7 @@ const columns = computed(() => [ align: 'left', sortable: true, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getInputEvents, @@ -237,7 +237,7 @@ const columns = computed(() => [ align: 'left', sortable: true, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getInputEvents, @@ -256,7 +256,7 @@ const columns = computed(() => [ align: 'left', sortable: true, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getInputEvents, @@ -309,7 +309,7 @@ const columns = computed(() => [ align: 'left', sortable: true, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getInputEvents, @@ -513,7 +513,7 @@ const columns = computed(() => [ align: 'left', sortable: true, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getInputEvents, diff --git a/src/pages/Entry/EntryLatestBuysFilter.vue b/src/pages/Entry/EntryLatestBuysFilter.vue index 9b2b5ae28..f83bb167a 100644 --- a/src/pages/Entry/EntryLatestBuysFilter.vue +++ b/src/pages/Entry/EntryLatestBuysFilter.vue @@ -4,7 +4,7 @@ import { useI18n } from 'vue-i18n'; import FetchData from 'components/FetchData.vue'; import VnInputDate from 'src/components/common/VnInputDate.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import ItemsFilterPanel from 'src/components/ItemsFilterPanel.vue'; const { t } = useI18n(); @@ -39,7 +39,7 @@ const suppliersOptions = ref([]); - + @@ -128,6 +128,69 @@ const suppliersOptions = ref([]); /> + + + + + + + + + + + + + + diff --git a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue index f557c8ef4..0a676b500 100644 --- a/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue +++ b/src/pages/InvoiceIn/Card/InvoiceInBasicData.vue @@ -7,7 +7,7 @@ import { useArrayData } from 'src/composables/useArrayData'; import { downloadFile } from 'src/composables/downloadFile'; import FormModel from 'components/FormModel.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import FetchData from 'src/components/FetchData.vue'; import axios from 'axios'; @@ -183,7 +183,7 @@ async function upsert() { - +
-
- - - - - - - data.deletes && router.push(`/invoice-in/${invoiceId}/s > - + - + - + - + - + - + - + - - + - - + {{ toCurrency(taxRate(props.row)) }} diff --git a/src/pages/InvoiceIn/InvoiceInFilter.vue b/src/pages/InvoiceIn/InvoiceInFilter.vue index 9b7c77f9d..8506ba2a8 100644 --- a/src/pages/InvoiceIn/InvoiceInFilter.vue +++ b/src/pages/InvoiceIn/InvoiceInFilter.vue @@ -2,7 +2,7 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnFilterPanel from 'src/components/ui/VnFilterPanel.vue'; import FetchData from 'components/FetchData.vue'; import VnInput from 'src/components/common/VnInput.vue'; @@ -40,7 +40,7 @@ const suppliersRef = ref(); - - + { - + - [ name: 'warehouse', ...defaultColumnAttrs, columnFilter: { - component: VnSelectFilter, + component: VnSelect, type: 'select', filterValue: null, event: getColumnInputEvents, @@ -434,7 +434,7 @@ onUnmounted(() => (stateStore.rightDrawer = false)); - + - + - { - { - { is-outlined class="filter-input" /> - - - - + @@ -160,7 +160,7 @@ const sourceList = ref(null); -
- - +
- - +
@@ -208,7 +208,7 @@ const orderFilter = {
- - +
diff --git a/src/pages/Parking/Card/ParkingBasicData.vue b/src/pages/Parking/Card/ParkingBasicData.vue index b03b7be7c..c1a9dcee8 100644 --- a/src/pages/Parking/Card/ParkingBasicData.vue +++ b/src/pages/Parking/Card/ParkingBasicData.vue @@ -6,7 +6,7 @@ import VnRow from 'components/ui/VnRow.vue'; import FetchData from 'src/components/FetchData.vue'; import VnInput from 'src/components/common/VnInput.vue'; import FormModel from 'components/FormModel.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; const { t } = useI18n(); const route = useRoute(); @@ -38,7 +38,7 @@ const filter = {
- - { - { - { - { - + @@ -192,7 +196,11 @@ const exprBuilder = (param, value) => { - + diff --git a/src/pages/Route/Card/RouteFilter.vue b/src/pages/Route/Card/RouteFilter.vue index bbd71df49..050e7c71d 100644 --- a/src/pages/Route/Card/RouteFilter.vue +++ b/src/pages/Route/Card/RouteFilter.vue @@ -3,7 +3,7 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import FetchData from 'components/FetchData.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; @@ -63,7 +63,7 @@ const warehouseList = ref([]); - + - - - { - +
- {
- props.layout === 'dialog'); />
- {
- { - +
{ />
- +
diff --git a/src/pages/Route/Roadmap/RoadmapFilter.vue b/src/pages/Route/Roadmap/RoadmapFilter.vue index b3fb7bf34..04c5c9696 100644 --- a/src/pages/Route/Roadmap/RoadmapFilter.vue +++ b/src/pages/Route/Roadmap/RoadmapFilter.vue @@ -3,7 +3,7 @@ import { ref } from 'vue'; import { useI18n } from 'vue-i18n'; import FetchData from 'components/FetchData.vue'; import VnFilterPanel from 'components/ui/VnFilterPanel.vue'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import VnInputDate from 'components/common/VnInputDate.vue'; import VnInput from 'components/common/VnInput.vue'; @@ -90,7 +90,7 @@ const exprBuilder = (param, value) => { - { -
+ diff --git a/src/pages/Route/RouteList.vue b/src/pages/Route/RouteList.vue index 773b4f773..c0888a225 100644 --- a/src/pages/Route/RouteList.vue +++ b/src/pages/Route/RouteList.vue @@ -4,7 +4,7 @@ import { useStateStore } from 'stores/useStateStore'; import { useI18n } from 'vue-i18n'; import { computed, onMounted, onUnmounted, ref } from 'vue'; import { dashIfEmpty, toHour } from 'src/filters'; -import VnSelectFilter from 'components/common/VnSelectFilter.vue'; +import VnSelect from 'components/common/VnSelect.vue'; import FetchData from 'components/FetchData.vue'; import { useValidator } from 'composables/useValidator'; import VnInputDate from 'components/common/VnInputDate.vue'; @@ -213,7 +213,7 @@ const openTicketsDialog = (id) => { - {{ t('Clone') }} + {{ t('globals.clone') }} @@ -287,7 +287,7 @@ const openTicketsDialog = (id) => { > - + - +
@@ -197,7 +196,7 @@ const redirectToTicketList = (_, { id }) => {
- {
-
-
-
- { />
- {
- { />
- { - { - { - { - { - {
- {
- { />
- { - - + - - - - - + diff --git a/src/pages/Worker/Card/WorkerPda.vue b/src/pages/Worker/Card/WorkerPda.vue index ef8c3fe8e..5e7c89326 100644 --- a/src/pages/Worker/Card/WorkerPda.vue +++ b/src/pages/Worker/Card/WorkerPda.vue @@ -4,7 +4,7 @@ import { useRoute } from 'vue-router'; import { onMounted, ref, computed } from 'vue'; import FetchData from 'components/FetchData.vue'; import FormModel from 'components/FormModel.vue'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import useNotify from 'src/composables/useNotify.js'; import axios from 'axios'; import { useRole } from 'src/composables/useRole'; @@ -107,7 +107,7 @@ onMounted(async () => await fetchCurrentDeviceRef.value.fetch()); - await fetchCurrentDeviceRef.value.fetch()); - + diff --git a/src/pages/Worker/Card/WorkerTimeForm.vue b/src/pages/Worker/Card/WorkerTimeForm.vue index d6c893ad1..0a58a04ca 100644 --- a/src/pages/Worker/Card/WorkerTimeForm.vue +++ b/src/pages/Worker/Card/WorkerTimeForm.vue @@ -3,7 +3,7 @@ import { reactive, ref, computed, onBeforeMount } from 'vue'; import { useI18n } from 'vue-i18n'; import { useRoute } from 'vue-router'; -import VnSelectFilter from 'src/components/common/VnSelectFilter.vue'; +import VnSelect from 'src/components/common/VnSelect.vue'; import FormModelPopup from 'components/FormModelPopup.vue'; import VnInputTime from 'components/common/VnInputTime.vue'; @@ -84,7 +84,7 @@ onBeforeMount(() => { :required="true" :is-clearable="false" /> - {
- { />
- { - +
- import('src/pages/Agency/Card/AgencyCard.vue'), + redirect: { name: 'AgencySummary' }, + children: [ + { + name: 'AgencySummary', + path: 'summary', + meta: { + title: 'summary', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/Card/AgencySummary.vue'), + }, + { + name: 'AgencyBasicData', + path: 'basic-data', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('pages/Agency/Card/AgencyBasicData.vue'), + }, + { + path: 'workCenter', + name: 'AgencyWorkCenterCard', + redirect: { name: 'AgencyWorkCenters' }, + children: [ + { + path: '', + name: 'AgencyWorkCenters', + meta: { + icon: 'apartment', + title: 'workCenters', + }, + component: () => + import('src/pages/Agency/Card/AgencyWorkcenter.vue'), + }, + ], + }, + { + path: 'modes', + name: 'AgencyModesCard', + redirect: { name: 'AgencyModes' }, + children: [ + { + path: '', + name: 'AgencyModes', + meta: { + icon: 'format_list_bulleted', + title: 'modes', + }, + component: () => + import('src/pages/Agency/Card/AgencyModes.vue'), + }, + ], + }, + { + name: 'AgencyLog', + path: 'log', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Agency/Card/AgencyLog.vue'), + }, + ], + }, + ], +}; diff --git a/src/router/modules/index.js b/src/router/modules/index.js index 302ba7fe0..6f4b0b35e 100644 --- a/src/router/modules/index.js +++ b/src/router/modules/index.js @@ -15,6 +15,7 @@ import Department from './department'; import Entry from './entry'; import roadmap from './roadmap'; import Parking from './parking'; +import Agency from './agency'; export default [ Item, @@ -34,4 +35,5 @@ export default [ Entry, roadmap, Parking, + Agency, ]; diff --git a/src/router/modules/item.js b/src/router/modules/item.js index 6bdd7b9ea..bc1e72a94 100644 --- a/src/router/modules/item.js +++ b/src/router/modules/item.js @@ -11,8 +11,16 @@ export default { component: RouterView, redirect: { name: 'ItemMain' }, menus: { - main: ['ItemList', 'WasteBreakdown', 'ItemFixedPrice'], - card: ['ItemBasicData'], + main: ['ItemList', 'WasteBreakdown', 'ItemFixedPrice', 'ItemRequest'], + card: [ + 'ItemBasicData', + 'ItemLog', + 'ItemDiary', + 'ItemTags', + 'ItemTax', + 'ItemBotanical', + 'ItemBarcode', + ], }, children: [ { @@ -60,6 +68,15 @@ export default { 'https://grafana.verdnatura.es/d/TTNXQAxVk'; }, }, + { + path: 'request', + name: 'ItemRequest', + meta: { + title: 'buyRequest', + icon: 'vn:buyrequest', + }, + component: () => import('src/pages/Item/ItemRequest.vue'), + }, ], }, { @@ -77,24 +94,6 @@ export default { }, component: () => import('src/pages/Item/Card/ItemSummary.vue'), }, - { - path: 'diary', - name: 'ItemDiary', - meta: { - title: 'diary', - icon: 'vn:transaction', - }, - component: () => import('src/pages/Item/Card/ItemDiary.vue'), - }, - { - path: 'tags', - name: 'ItemTags', - meta: { - title: 'Tags', - icon: 'vn:tags', - }, - component: () => import('src/pages/Item/Card/ItemTags.vue'), - }, { path: 'basic-data', name: 'ItemBasicData', @@ -104,6 +103,60 @@ export default { }, component: () => import('src/pages/Item/Card/ItemBasicData.vue'), }, + { + path: 'tags', + name: 'ItemTags', + meta: { + title: 'tags', + icon: 'vn:tags', + }, + component: () => import('src/pages/Item/Card/ItemTags.vue'), + }, + { + path: 'tax', + name: 'ItemTax', + meta: { + title: 'tax', + icon: 'vn:tax', + }, + component: () => import('src/pages/Item/Card/ItemTax.vue'), + }, + { + path: 'barcode', + name: 'ItemBarcode', + meta: { + title: 'barcode', + icon: 'vn:barcode', + }, + component: () => import('src/pages/Item/Card/ItemBarcode.vue'), + }, + { + path: 'diary', + name: 'ItemDiary', + meta: { + title: 'basicData', + icon: 'vn:settings', + }, + component: () => import('src/pages/Item/Card/ItemDiary.vue'), + }, + { + path: 'log', + name: 'ItemLog', + meta: { + title: 'log', + icon: 'history', + }, + component: () => import('src/pages/Item/Card/ItemLog.vue'), + }, + { + path: 'botanical', + name: 'ItemBotanical', + meta: { + title: 'botanical', + icon: 'vn:botanical', + }, + component: () => import('src/pages/Item/Card/ItemBotanical.vue'), + }, ], }, ], diff --git a/src/router/modules/route.js b/src/router/modules/route.js index f8ededf55..8e08d7222 100644 --- a/src/router/modules/route.js +++ b/src/router/modules/route.js @@ -11,7 +11,7 @@ export default { component: RouterView, redirect: { name: 'RouteMain' }, menus: { - main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList'], + main: ['RouteList', 'RouteAutonomous', 'RouteRoadmap', 'CmrList', 'AgencyList'], card: ['RouteBasicData', 'RouteTickets', 'RouteLog'], }, children: [ @@ -75,6 +75,21 @@ export default { }, component: () => import('src/pages/Route/Cmr/CmrList.vue'), }, + { + path: '/agency', + redirect: { name: 'AgencyList' }, + children: [ + { + path: 'list', + name: 'AgencyList', + meta: { + title: 'agencyList', + icon: 'view_list', + }, + component: () => import('src/pages/Agency/AgencyList.vue'), + }, + ], + }, ], }, { diff --git a/src/router/routes.js b/src/router/routes.js index 51e726a62..ca52441e7 100644 --- a/src/router/routes.js +++ b/src/router/routes.js @@ -15,6 +15,7 @@ import order from 'src/router/modules/order'; import entry from 'src/router/modules/entry'; import roadmap from 'src/router/modules/roadmap'; import parking from 'src/router/modules/parking'; +import agency from 'src/router/modules/agency'; const routes = [ { @@ -71,6 +72,7 @@ const routes = [ roadmap, entry, parking, + agency, { path: '/:catchAll(.*)*', name: 'NotFound', diff --git a/test/cypress/integration/agency/agencyWorkCenter.spec.js b/test/cypress/integration/agency/agencyWorkCenter.spec.js new file mode 100644 index 000000000..ff3c53214 --- /dev/null +++ b/test/cypress/integration/agency/agencyWorkCenter.spec.js @@ -0,0 +1,50 @@ +describe('AgencyWorkCenter', () => { + beforeEach(() => { + cy.viewport(1920, 1080); + cy.login('developer'); + cy.visit(`/#/agency`); + }); + + it('assign 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( + '.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-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', + 'WorkCenter 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( + '.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-notification__message').should('have.text', 'Data created'); + 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'); + }); +}); diff --git a/test/vitest/__tests__/pages/Claims/ClaimLinesImport.spec.js b/test/vitest/__tests__/pages/Claims/ClaimLinesImport.spec.js index 085118b14..d93c96132 100644 --- a/test/vitest/__tests__/pages/Claims/ClaimLinesImport.spec.js +++ b/test/vitest/__tests__/pages/Claims/ClaimLinesImport.spec.js @@ -5,7 +5,6 @@ import ClaimLinesImport from 'pages/Claim/Card/ClaimLinesImport.vue'; describe('ClaimLinesImport', () => { let vm; - beforeAll(() => { vm = createWrapper(ClaimLinesImport, { global: { @@ -13,7 +12,7 @@ describe('ClaimLinesImport', () => { mocks: { fetch: vi.fn(), }, - } + }, }).vm; }); @@ -26,25 +25,23 @@ describe('ClaimLinesImport', () => { vi.spyOn(axios, 'post').mockResolvedValue({ data: true }); vi.spyOn(vm.quasar, 'notify'); - vm.selected = [ - { id: 1, saleFk: 1, claimFk: 1, quantity: 10 } - ] + vm.selected = [{ id: 1, saleFk: 1, claimFk: 1 }]; - vm.route.params.id = 1 + vm.route.params.id = 1; await vm.importLines(); - const expectedData = [{ saleFk: 1, claimFk: 1, quantity: 10 }] + const expectedData = [{ saleFk: 1, claimFk: 1 }]; expect(axios.post).toHaveBeenCalledWith('ClaimBeginnings', expectedData, { - signal: expect.any(Object) - }) + signal: expect.any(Object), + }); expect(vm.quasar.notify).toHaveBeenCalledWith( expect.objectContaining({ message: 'Lines added to claim', - type: 'positive' + type: 'positive', }) ); - expect(vm.canceller).toEqual(null) + expect(vm.canceller).toEqual(null); }); }); }); diff --git a/test/vitest/setup-file.js b/test/vitest/setup-file.js index 499204981..288f80beb 100644 --- a/test/vitest/setup-file.js +++ b/test/vitest/setup-file.js @@ -1 +1 @@ -// This file will be run before each test file +// This file will be run before each test file, don't delete or vitest will not work.