diff --git a/src/pages/Zone/ZoneList.vue b/src/pages/Zone/ZoneList.vue
index 033aecab7d..2e65ab39fd 100644
--- a/src/pages/Zone/ZoneList.vue
+++ b/src/pages/Zone/ZoneList.vue
@@ -14,6 +14,7 @@ import VnTable from 'src/components/VnTable/VnTable.vue';
import VnSelect from 'src/components/common/VnSelect.vue';
import VnInput from 'src/components/common/VnInput.vue';
import VnInputTime from 'src/components/common/VnInputTime.vue';
+import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
const { t } = useI18n();
const router = useRouter();
@@ -114,6 +115,13 @@ const handleClone = (id) => {
+
-import { useI18n } from 'vue-i18n';
import { useStateStore } from 'stores/useStateStore';
import LeftMenu from 'src/components/LeftMenu.vue';
-import VnSearchbar from 'src/components/ui/VnSearchbar.vue';
-const { t } = useI18n();
const stateStore = useStateStore();
-
-const exprBuilder = (param, value) => {
- switch (param) {
- case 'name':
- return {
- name: { like: `%${value}%` },
- };
- case 'code':
- return {
- code: { like: `%${value}%` },
- };
- case 'agencyModeFk':
- return {
- agencyModeFk: value,
- };
- case 'search':
- if (value) {
- if (!isNaN(value)) {
- return { id: value };
- } else {
- return {
- name: {
- like: `%${value}%`,
- },
- };
- }
- }
- }
-};
-
diff --git a/test/cypress/integration/zone/zoneBasicData.spec.js b/test/cypress/integration/zone/zoneBasicData.spec.js
new file mode 100644
index 0000000000..18b1842a4f
--- /dev/null
+++ b/test/cypress/integration/zone/zoneBasicData.spec.js
@@ -0,0 +1,23 @@
+describe('ZoneCreate', () => {
+ const notification = '.q-notification__message';
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/zone/4/basic-data');
+ });
+
+ it('should throw an error if the name is empty', () => {
+ cy.get('.q-card > :nth-child(1)').click();
+ cy.get('.q-card > :nth-child(1)').clear();
+ cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.get(notification).should('contains.text', "can't be blank");
+ });
+
+ it("should edit the basicData's zone", () => {
+ cy.get('.q-card > :nth-child(1)').click();
+ cy.get('.q-card > :nth-child(1)').type(' modified');
+ cy.get('.q-btn-group > .q-btn--standard').click();
+ cy.get(notification).should('contains.text', 'Data saved');
+ });
+});
diff --git a/test/cypress/integration/zone/zoneCreate.spec.js b/test/cypress/integration/zone/zoneCreate.spec.js
new file mode 100644
index 0000000000..668c485e7d
--- /dev/null
+++ b/test/cypress/integration/zone/zoneCreate.spec.js
@@ -0,0 +1,45 @@
+describe('ZoneCreate', () => {
+ const notification = '.q-notification__message';
+
+ const data = {
+ Name: { val: 'Zone pickup D' },
+ Price: { val: '3' },
+ Bonus: { val: '0' },
+ 'Traveling days': { val: '0' },
+ Close: {
+ val: {
+ h: '10',
+ m: '0',
+ x: 'PM',
+ },
+ type: 'time',
+ day: 11,
+ },
+ Warehouse: { val: 'Algemesi', type: 'select' },
+ Volumetric: { val: 'true', type: 'checkbox' },
+ };
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/zone/list');
+ cy.get('.q-page-sticky > div > .q-btn').click();
+ });
+
+ it('should throw an error if an agency has not been selected', () => {
+ cy.fillInForm({
+ ...data,
+ });
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.get(notification).should('contains.text', 'Agency cannot be blank');
+ });
+
+ it('should create a zone', () => {
+ cy.fillInForm({
+ ...data,
+ Agency: { val: 'inhouse pickup', type: 'select' },
+ });
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ cy.get(notification).should('contains.text', 'Data created');
+ });
+});
diff --git a/test/cypress/integration/zone/zoneList.spec.js b/test/cypress/integration/zone/zoneList.spec.js
new file mode 100644
index 0000000000..030250d74e
--- /dev/null
+++ b/test/cypress/integration/zone/zoneList.spec.js
@@ -0,0 +1,19 @@
+describe('ZoneList', () => {
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit('/#/zone/list');
+ });
+
+ it('should filter by agency', () => {
+ cy.get('.bg-header > :nth-child(3) > .full-width > :nth-child(1) >').type(
+ '{downArrow}{enter}'
+ );
+ });
+
+ it('should open the zone summary', () => {
+ cy.get('.bg-header > :nth-child(2) > .full-width > :nth-child(1) >').type(
+ 'zone refund{enter}'
+ );
+ });
+});
diff --git a/test/cypress/integration/zone/zoneWarehouse.spec.js b/test/cypress/integration/zone/zoneWarehouse.spec.js
new file mode 100644
index 0000000000..3ffa3f69d7
--- /dev/null
+++ b/test/cypress/integration/zone/zoneWarehouse.spec.js
@@ -0,0 +1,34 @@
+describe('ZoneWarehouse', () => {
+ const data = {
+ Warehouse: { val: 'Algemesi', type: 'select' },
+ };
+ const deviceProductionField =
+ '.vn-row > :nth-child(1) > .q-field > .q-field__inner > .q-field__control > .q-field__control-container';
+ const dataError = "ER_DUP_ENTRY: Duplicate entry '2-2' for key 'zoneFk'";
+
+ beforeEach(() => {
+ cy.viewport(1280, 720);
+ cy.login('developer');
+ cy.visit(`/#/zone/2/warehouses`);
+ });
+
+ it('should throw an error if the warehouse chosen is already put in the zone', () => {
+ cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(deviceProductionField).click();
+ cy.get(deviceProductionField).type('{upArrow}{enter}');
+ cy.get('.q-notification__message').should('have.text', dataError);
+ });
+
+ it('should create a warehouse', () => {
+ cy.get('.q-page-sticky > div > .q-btn > .q-btn__content > .q-icon').click();
+ cy.get(deviceProductionField).click();
+ cy.fillInForm(data);
+ cy.get('.q-mt-lg > .q-btn--standard').click();
+ });
+
+ it('should delete a warehouse', () => {
+ cy.get('tbody > :nth-child(2) > :nth-child(2) > .q-icon').click();
+ cy.get('.q-card__actions > .q-btn--flat > .q-btn__content').click();
+ cy.reload();
+ });
+});
diff --git a/test/cypress/support/commands.js b/test/cypress/support/commands.js
index 38a23f71c3..33cc666f5c 100755
--- a/test/cypress/support/commands.js
+++ b/test/cypress/support/commands.js
@@ -108,6 +108,12 @@ Cypress.Commands.add('fillInForm', (obj, form = '.q-form > .q-card') => {
.eq(day ? day - 1 : 0)
.click();
break;
+ case 'time':
+ cy.wrap(el).click();
+ cy.get('.q-time .q-time__clock').contains(val.h).click();
+ cy.get('.q-time .q-time__clock').contains(val.m).click();
+ cy.get('.q-time .q-time__link').contains(val.x).click();
+ break;
default:
cy.wrap(el).type(val);
break;