refactor: request changes
gitea/salix-front/pipeline/pr-dev This commit looks good Details

This commit is contained in:
Jon Elias 2025-01-31 07:56:40 +01:00
parent f70dd41a37
commit 4246275759
4 changed files with 16 additions and 14 deletions

View File

@ -53,6 +53,7 @@ const url = computed(() => {
:fields="['id', 'name', 'nickname', 'code']" :fields="['id', 'name', 'nickname', 'code']"
:filter-options="['id', 'name', 'nickname', 'code']" :filter-options="['id', 'name', 'nickname', 'code']"
sort-by="nickname ASC" sort-by="nickname ASC"
data-cy="vnWorkerSelect"
> >
<template #prepend v-if="$props.hasAvatar"> <template #prepend v-if="$props.hasAvatar">
<VnAvatar :worker-id="value" color="primary" v-bind="$attrs" /> <VnAvatar :worker-id="value" color="primary" v-bind="$attrs" />

View File

@ -185,13 +185,11 @@ const columns = computed(() => [
:label="t('globals.name')" :label="t('globals.name')"
data-cy="nameInput" data-cy="nameInput"
/> />
<VnSelectWorker v-model="data.workerFk" data-cy="workerSelect" /> <VnSelectWorker v-model="data.workerFk" />
<VnSelect <VnSelect
:label="t('ItemCategory')" :label="t('ItemCategory')"
v-model="data.categoryFk" v-model="data.categoryFk"
:options="itemCategoriesOptions" :options="itemCategoriesOptions"
option-value="id"
option-label="name"
hide-selected hide-selected
data-cy="itemCategorySelect" data-cy="itemCategorySelect"
/> />
@ -199,8 +197,6 @@ const columns = computed(() => [
:label="t('Temperature')" :label="t('Temperature')"
v-model="data.temperatureFk" v-model="data.temperatureFk"
:options="temperatureOptions" :options="temperatureOptions"
option-value="id"
option-label="name"
hide-selected hide-selected
data-cy="temperatureSelect" data-cy="temperatureSelect"
/> />

View File

@ -1,5 +1,5 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Item shelving', () => { describe('ItemBarcodes', () => {
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');

View File

@ -1,5 +1,10 @@
/// <reference types="cypress" /> /// <reference types="cypress" />
describe('Item type', () => { describe('Item type', () => {
const workerError = 'employeeNick';
const worker = 'buyerNick';
const category = 'Artificial';
const type = 'Flower';
beforeEach(() => { beforeEach(() => {
cy.viewport(1920, 1080); cy.viewport(1920, 1080);
cy.login('developer'); cy.login('developer');
@ -10,10 +15,10 @@ describe('Item type', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('codeInput').type('ALS'); cy.dataCy('codeInput').type('ALS');
cy.dataCy('nameInput').type('Alstroemeria'); cy.dataCy('nameInput').type('Alstroemeria');
cy.dataCy('workerSelect').type('employeeNick'); cy.dataCy('vnWorkerSelect').type(workerError);
cy.get('.q-menu .q-item').contains('employeeNick').click(); cy.get('.q-menu .q-item').contains(workerError).click();
cy.dataCy('itemCategorySelect').type('Artificial'); cy.dataCy('itemCategorySelect').type(category);
cy.get('.q-menu .q-item').contains('Artificial').click(); cy.get('.q-menu .q-item').contains(category).click();
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('An item type with the same code already exists'); cy.checkNotification('An item type with the same code already exists');
}); });
@ -22,10 +27,10 @@ describe('Item type', () => {
cy.dataCy('vnTableCreateBtn').click(); cy.dataCy('vnTableCreateBtn').click();
cy.dataCy('codeInput').type('LIL'); cy.dataCy('codeInput').type('LIL');
cy.dataCy('nameInput').type('Lilium'); cy.dataCy('nameInput').type('Lilium');
cy.dataCy('workerSelect').type('buyerNick'); cy.dataCy('vnWorkerSelect').type(worker);
cy.get('.q-menu .q-item').contains('buyerNick').click(); cy.get('.q-menu .q-item').contains(worker).click();
cy.dataCy('itemCategorySelect').type('Flower'); cy.dataCy('itemCategorySelect').type(type);
cy.get('.q-menu .q-item').contains('Flower').click(); cy.get('.q-menu .q-item').contains(type).click();
cy.dataCy('FormModelPopup_save').click(); cy.dataCy('FormModelPopup_save').click();
cy.checkNotification('Data created'); cy.checkNotification('Data created');
}); });