Merge branch 'test' of https://gitea.verdnatura.es/verdnatura/salix-front into dev
gitea/salix-front/pipeline/head This commit looks good
Details
gitea/salix-front/pipeline/head This commit looks good
Details
This commit is contained in:
commit
40d59846fa
|
@ -17,17 +17,6 @@ defineProps({ row: { type: Object, required: true } });
|
||||||
</QTooltip>
|
</QTooltip>
|
||||||
</QIcon>
|
</QIcon>
|
||||||
</router-link>
|
</router-link>
|
||||||
<QIcon
|
|
||||||
v-if="row?.reserved"
|
|
||||||
color="primary"
|
|
||||||
name="vn:reserva"
|
|
||||||
size="xs"
|
|
||||||
data-cy="ticketSaleReservedIcon"
|
|
||||||
>
|
|
||||||
<QTooltip>
|
|
||||||
{{ t('ticketSale.reserved') }}
|
|
||||||
</QTooltip>
|
|
||||||
</QIcon>
|
|
||||||
<QIcon
|
<QIcon
|
||||||
v-if="row?.isDeleted"
|
v-if="row?.isDeleted"
|
||||||
color="primary"
|
color="primary"
|
||||||
|
|
|
@ -1,35 +1,14 @@
|
||||||
<script setup>
|
<script setup>
|
||||||
import { nextTick, ref } from 'vue';
|
|
||||||
import VnInput from './VnInput.vue';
|
import VnInput from './VnInput.vue';
|
||||||
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
import { useAccountShortToStandard } from 'src/composables/useAccountShortToStandard';
|
||||||
|
|
||||||
const $props = defineProps({
|
|
||||||
insertable: {
|
|
||||||
type: Boolean,
|
|
||||||
default: false,
|
|
||||||
},
|
|
||||||
});
|
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue', 'accountShortToStandard']);
|
|
||||||
const model = defineModel({ prop: 'modelValue' });
|
const model = defineModel({ prop: 'modelValue' });
|
||||||
const inputRef = ref(false);
|
|
||||||
|
|
||||||
function setCursorPosition(pos) {
|
|
||||||
const input = inputRef.value.vnInputRef.$el.querySelector('input');
|
|
||||||
input.focus();
|
|
||||||
input.setSelectionRange(pos, pos);
|
|
||||||
}
|
|
||||||
|
|
||||||
async function handleUpdateModel(val) {
|
|
||||||
model.value = val?.at(-1) === '.' ? useAccountShortToStandard(val) : val;
|
|
||||||
await nextTick(() => setCursorPosition(0));
|
|
||||||
}
|
|
||||||
</script>
|
</script>
|
||||||
<template>
|
<template>
|
||||||
<VnInput
|
<VnInput
|
||||||
v-model="model"
|
v-model="model"
|
||||||
ref="inputRef"
|
ref="inputRef"
|
||||||
:insertable
|
@keydown.tab="model = useAccountShortToStandard($event.target.value) ?? model"
|
||||||
@update:model-value="handleUpdateModel"
|
@input="model = $event.target.value.replace(/[^\d.]/g, '')"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -23,18 +23,19 @@ describe('useRole', () => {
|
||||||
name: `T'Challa`,
|
name: `T'Challa`,
|
||||||
nickname: 'Black Panther',
|
nickname: 'Black Panther',
|
||||||
lang: 'en',
|
lang: 'en',
|
||||||
|
worker: { department: { departmentFk: 155 } },
|
||||||
};
|
};
|
||||||
const expectedUser = {
|
const expectedUser = {
|
||||||
id: 999,
|
id: 999,
|
||||||
name: `T'Challa`,
|
name: `T'Challa`,
|
||||||
nickname: 'Black Panther',
|
nickname: 'Black Panther',
|
||||||
lang: 'en',
|
lang: 'en',
|
||||||
|
departmentFk: 155,
|
||||||
};
|
};
|
||||||
const expectedRoles = ['salesPerson', 'admin'];
|
const expectedRoles = ['salesPerson', 'admin'];
|
||||||
vi.spyOn(axios, 'get')
|
vi.spyOn(axios, 'get').mockResolvedValueOnce({
|
||||||
.mockResolvedValueOnce({
|
|
||||||
data: { roles: rolesData, user: fetchedUser },
|
data: { roles: rolesData, user: fetchedUser },
|
||||||
})
|
});
|
||||||
|
|
||||||
vi.spyOn(role.state, 'setUser');
|
vi.spyOn(role.state, 'setUser');
|
||||||
vi.spyOn(role.state, 'setRoles');
|
vi.spyOn(role.state, 'setRoles');
|
||||||
|
|
|
@ -75,6 +75,7 @@ describe('session', () => {
|
||||||
userConfig: {
|
userConfig: {
|
||||||
darkMode: false,
|
darkMode: false,
|
||||||
},
|
},
|
||||||
|
worker: { department: { departmentFk: 155 } },
|
||||||
};
|
};
|
||||||
const rolesData = [
|
const rolesData = [
|
||||||
{
|
{
|
||||||
|
@ -143,7 +144,7 @@ describe('session', () => {
|
||||||
await session.destroy(); // this clears token and user for any other test
|
await session.destroy(); // this clears token and user for any other test
|
||||||
});
|
});
|
||||||
},
|
},
|
||||||
{}
|
{},
|
||||||
);
|
);
|
||||||
|
|
||||||
describe('RenewToken', () => {
|
describe('RenewToken', () => {
|
||||||
|
@ -175,7 +176,7 @@ describe('session', () => {
|
||||||
await session.checkValidity();
|
await session.checkValidity();
|
||||||
expect(sessionStorage.getItem('token')).toEqual(expectedToken);
|
expect(sessionStorage.getItem('token')).toEqual(expectedToken);
|
||||||
expect(sessionStorage.getItem('tokenMultimedia')).toEqual(
|
expect(sessionStorage.getItem('tokenMultimedia')).toEqual(
|
||||||
expectedTokenMultimedia
|
expectedTokenMultimedia,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
it('Should renewToken', async () => {
|
it('Should renewToken', async () => {
|
||||||
|
@ -204,7 +205,7 @@ describe('session', () => {
|
||||||
await session.checkValidity();
|
await session.checkValidity();
|
||||||
expect(sessionStorage.getItem('token')).not.toEqual(expectedToken);
|
expect(sessionStorage.getItem('token')).not.toEqual(expectedToken);
|
||||||
expect(sessionStorage.getItem('tokenMultimedia')).not.toEqual(
|
expect(sessionStorage.getItem('tokenMultimedia')).not.toEqual(
|
||||||
expectedTokenMultimedia
|
expectedTokenMultimedia,
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
|
@ -13,6 +13,7 @@ export function useRole() {
|
||||||
name: data.user.name,
|
name: data.user.name,
|
||||||
nickname: data.user.nickname,
|
nickname: data.user.nickname,
|
||||||
lang: data.user.lang || 'es',
|
lang: data.user.lang || 'es',
|
||||||
|
departmentFk: data.user.worker.department.departmentFk,
|
||||||
};
|
};
|
||||||
state.setUser(userData);
|
state.setUser(userData);
|
||||||
state.setRoles(roles);
|
state.setRoles(roles);
|
||||||
|
|
|
@ -115,6 +115,7 @@ const props = defineProps({
|
||||||
<i18n>
|
<i18n>
|
||||||
en:
|
en:
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Department
|
||||||
search: Contains
|
search: Contains
|
||||||
clientFk: Customer
|
clientFk: Customer
|
||||||
clientName: Customer
|
clientName: Customer
|
||||||
|
@ -127,6 +128,7 @@ en:
|
||||||
zoneFk: Zone
|
zoneFk: Zone
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Departamento
|
||||||
search: Contiene
|
search: Contiene
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
clientName: Cliente
|
clientName: Cliente
|
||||||
|
|
|
@ -156,6 +156,7 @@ en:
|
||||||
email: Email
|
email: Email
|
||||||
isToBeMailed: Mailed
|
isToBeMailed: Mailed
|
||||||
isEqualizated: Equailized
|
isEqualizated: Equailized
|
||||||
|
departmentFk: Department
|
||||||
businessTypeFk: Business type
|
businessTypeFk: Business type
|
||||||
sageTaxTypeFk: Sage Tax Type
|
sageTaxTypeFk: Sage Tax Type
|
||||||
sageTransactionTypeFk: Sage Tax Type
|
sageTransactionTypeFk: Sage Tax Type
|
||||||
|
@ -166,6 +167,7 @@ en:
|
||||||
postcode: Postcode
|
postcode: Postcode
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Departamento
|
||||||
search: Contiene
|
search: Contiene
|
||||||
fi: NIF
|
fi: NIF
|
||||||
isActive: Activo
|
isActive: Activo
|
||||||
|
|
|
@ -192,8 +192,10 @@ en:
|
||||||
date: L. O. Date
|
date: L. O. Date
|
||||||
credit: Credit I.
|
credit: Credit I.
|
||||||
defaulterSinced: From
|
defaulterSinced: From
|
||||||
|
departmentFk: Department
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Departamento
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
countryFk: País
|
countryFk: País
|
||||||
paymentMethod: F. Pago
|
paymentMethod: F. Pago
|
||||||
|
|
|
@ -9,12 +9,14 @@ import VnInputDate from 'src/components/common/VnInputDate.vue';
|
||||||
import VnRow from 'src/components/ui/VnRow.vue';
|
import VnRow from 'src/components/ui/VnRow.vue';
|
||||||
import { dateRange } from 'src/filters';
|
import { dateRange } from 'src/filters';
|
||||||
import useOpenURL from 'src/composables/useOpenURL';
|
import useOpenURL from 'src/composables/useOpenURL';
|
||||||
|
import { useState } from 'src/composables/useState';
|
||||||
const { t } = useI18n();
|
const { t } = useI18n();
|
||||||
|
|
||||||
const dates = dateRange(Date.vnNew());
|
const dates = dateRange(Date.vnNew());
|
||||||
const from = ref(dates[0]);
|
const from = ref(dates[0]);
|
||||||
const to = ref(dates[1]);
|
const to = ref(dates[1]);
|
||||||
|
|
||||||
|
const state = useState();
|
||||||
const filter = computed(() => {
|
const filter = computed(() => {
|
||||||
const obj = {};
|
const obj = {};
|
||||||
const formatFrom = setHours(from.value, 'from');
|
const formatFrom = setHours(from.value, 'from');
|
||||||
|
@ -24,16 +26,18 @@ const filter = computed(() => {
|
||||||
if (!formatFrom && formatTo) stamp = { lte: formatTo };
|
if (!formatFrom && formatTo) stamp = { lte: formatTo };
|
||||||
else if (formatFrom && !formatTo) stamp = { gte: formatFrom };
|
else if (formatFrom && !formatTo) stamp = { gte: formatFrom };
|
||||||
else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] };
|
else if (formatFrom && formatTo) stamp = { between: [formatFrom, formatTo] };
|
||||||
|
return Object.assign(obj, {
|
||||||
return Object.assign(obj, { where: { 'v.stamp': stamp } });
|
where: {
|
||||||
|
'v.stamp': stamp,
|
||||||
|
'c.departmentFk': state.getUser().value.departmentFk,
|
||||||
|
},
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
function exprBuilder(param, value) {
|
function exprBuilder(param, value) {
|
||||||
switch (param) {
|
switch (param) {
|
||||||
case 'clientFk':
|
case 'clientFk':
|
||||||
return { [`c.id`]: value };
|
return { [`c.id`]: value };
|
||||||
case 'departmentFk':
|
|
||||||
return { [`c.${param}`]: value };
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -66,9 +70,13 @@ const columns = computed(() => [
|
||||||
align: 'left',
|
align: 'left',
|
||||||
name: 'departmentFk',
|
name: 'departmentFk',
|
||||||
label: t('customer.summary.team'),
|
label: t('customer.summary.team'),
|
||||||
component: 'select',
|
columnFilter: {
|
||||||
attrs: {
|
component: 'select',
|
||||||
url: 'Departments',
|
attrs: {
|
||||||
|
url: 'Departments',
|
||||||
|
},
|
||||||
|
alias: 'c',
|
||||||
|
inWhere: true,
|
||||||
},
|
},
|
||||||
columnField: {
|
columnField: {
|
||||||
component: null,
|
component: null,
|
||||||
|
|
|
@ -130,8 +130,10 @@ en:
|
||||||
myTeam: My Team
|
myTeam: My Team
|
||||||
isConfirmed: Order Confirmed
|
isConfirmed: Order Confirmed
|
||||||
showEmpty: Show Empty
|
showEmpty: Show Empty
|
||||||
|
departmentFk: Department
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Departamento
|
||||||
search: Búsqueda
|
search: Búsqueda
|
||||||
clientFk: Cliente
|
clientFk: Cliente
|
||||||
agencyModeFk: Agencia
|
agencyModeFk: Agencia
|
||||||
|
|
|
@ -187,7 +187,9 @@ const getRowUpdateInputEvents = (sale) => {
|
||||||
|
|
||||||
const resetChanges = async () => {
|
const resetChanges = async () => {
|
||||||
arrayData.fetch({ append: false });
|
arrayData.fetch({ append: false });
|
||||||
tableRef.value.reload();
|
tableRef.value.CrudModelRef.hasChanges = false;
|
||||||
|
await tableRef.value.reload();
|
||||||
|
|
||||||
selectedRows.value = [];
|
selectedRows.value = [];
|
||||||
};
|
};
|
||||||
const changeQuantity = async (sale) => {
|
const changeQuantity = async (sale) => {
|
||||||
|
@ -392,7 +394,7 @@ const changeTicketState = async (val) => {
|
||||||
const params = { ticketFk: route.params.id, code: val };
|
const params = { ticketFk: route.params.id, code: val };
|
||||||
await axios.post('Tickets/state', params);
|
await axios.post('Tickets/state', params);
|
||||||
notify('globals.dataSaved', 'positive');
|
notify('globals.dataSaved', 'positive');
|
||||||
await resetChanges();
|
resetChanges();
|
||||||
};
|
};
|
||||||
|
|
||||||
const removeSelectedSales = () => {
|
const removeSelectedSales = () => {
|
||||||
|
|
|
@ -62,6 +62,7 @@ const isClaimable = computed(() => {
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
});
|
});
|
||||||
|
|
||||||
const sendSms = async (params) => {
|
const sendSms = async (params) => {
|
||||||
await axios.post(`Tickets/${ticket.value.id}/sendSms`, params);
|
await axios.post(`Tickets/${ticket.value.id}/sendSms`, params);
|
||||||
notify(t('SMS sent'), 'positive');
|
notify(t('SMS sent'), 'positive');
|
||||||
|
@ -230,18 +231,6 @@ const createRefund = async (withWarehouse) => {
|
||||||
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
<QItemLabel>{{ t('Add claim') }}</QItemLabel>
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
</QItem>
|
</QItem>
|
||||||
<QItem
|
|
||||||
v-if="isTicketEditable"
|
|
||||||
clickable
|
|
||||||
v-close-popup
|
|
||||||
v-ripple
|
|
||||||
@click="setReserved(true)"
|
|
||||||
data-cy="markAsReservedItem"
|
|
||||||
>
|
|
||||||
<QItemSection>
|
|
||||||
<QItemLabel>{{ t('Mark as reserved') }}</QItemLabel>
|
|
||||||
</QItemSection>
|
|
||||||
</QItem>
|
|
||||||
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
<QItem clickable v-ripple data-cy="ticketSaleRefundItem">
|
||||||
<QItemSection>
|
<QItemSection>
|
||||||
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
<QItemLabel>{{ t('Refund') }}</QItemLabel>
|
||||||
|
@ -287,8 +276,6 @@ es:
|
||||||
Recalculate price: Recalcular precio
|
Recalculate price: Recalcular precio
|
||||||
Update discount: Actualizar descuento
|
Update discount: Actualizar descuento
|
||||||
Add claim: Crear reclamación
|
Add claim: Crear reclamación
|
||||||
Mark as reserved: Marcar como reservado
|
|
||||||
Unmark as reserved: Desmarcar como reservado
|
|
||||||
Refund: Abono
|
Refund: Abono
|
||||||
with warehouse: con almacén
|
with warehouse: con almacén
|
||||||
without warehouse: sin almacén
|
without warehouse: sin almacén
|
||||||
|
|
|
@ -22,16 +22,6 @@ const states = ref([]);
|
||||||
const agencies = ref([]);
|
const agencies = ref([]);
|
||||||
const warehouses = ref([]);
|
const warehouses = ref([]);
|
||||||
const groupedStates = ref([]);
|
const groupedStates = ref([]);
|
||||||
|
|
||||||
const getGroupedStates = (data) => {
|
|
||||||
for (const state of data) {
|
|
||||||
groupedStates.value.push({
|
|
||||||
id: state.id,
|
|
||||||
name: t(`${state.code}`),
|
|
||||||
code: state.code,
|
|
||||||
});
|
|
||||||
}
|
|
||||||
};
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
@ -39,12 +29,11 @@ const getGroupedStates = (data) => {
|
||||||
<FetchData url="States" @on-fetch="(data) => (states = data)" auto-load />
|
<FetchData url="States" @on-fetch="(data) => (states = data)" auto-load />
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AlertLevels"
|
url="AlertLevels"
|
||||||
@on-fetch="
|
|
||||||
(data) => {
|
|
||||||
getGroupedStates(data);
|
|
||||||
}
|
|
||||||
"
|
|
||||||
auto-load
|
auto-load
|
||||||
|
@on-fetch="
|
||||||
|
(data) =>
|
||||||
|
(groupedStates = data.map((x) => Object.assign(x, { code: t(x.code) })))
|
||||||
|
"
|
||||||
/>
|
/>
|
||||||
<FetchData
|
<FetchData
|
||||||
url="AgencyModes"
|
url="AgencyModes"
|
||||||
|
@ -126,12 +115,11 @@ const getGroupedStates = (data) => {
|
||||||
</QItemSection>
|
</QItemSection>
|
||||||
<QItemSection v-if="groupedStates">
|
<QItemSection v-if="groupedStates">
|
||||||
<VnSelect
|
<VnSelect
|
||||||
:label="t('Grouped state')"
|
:label="t('params.groupedStates')"
|
||||||
v-model="params.groupedStates"
|
v-model="params.groupedStates"
|
||||||
@update:model-value="searchFn()"
|
@update:model-value="searchFn()"
|
||||||
:options="groupedStates"
|
:options="groupedStates"
|
||||||
option-value="id"
|
option-label="code"
|
||||||
option-label="name"
|
|
||||||
emit-value
|
emit-value
|
||||||
map-options
|
map-options
|
||||||
use-input
|
use-input
|
||||||
|
@ -304,7 +292,7 @@ en:
|
||||||
ON_PREPARATION: On preparation
|
ON_PREPARATION: On preparation
|
||||||
PACKED: Packed
|
PACKED: Packed
|
||||||
DELIVERED: Delivered
|
DELIVERED: Delivered
|
||||||
ON_PREVIOUS: ON_PREVIOUS
|
ON_PREVIOUS: On previous
|
||||||
es:
|
es:
|
||||||
params:
|
params:
|
||||||
search: Contiene
|
search: Contiene
|
||||||
|
@ -349,7 +337,7 @@ es:
|
||||||
ON_PREPARATION: En preparación
|
ON_PREPARATION: En preparación
|
||||||
PACKED: Encajado
|
PACKED: Encajado
|
||||||
DELIVERED: Servido
|
DELIVERED: Servido
|
||||||
ON_PREVIOUS: ON_PREVIOUS
|
ON_PREVIOUS: En previa
|
||||||
Collection: Colección
|
Collection: Colección
|
||||||
Nickname: Nombre mostrado
|
Nickname: Nombre mostrado
|
||||||
</i18n>
|
</i18n>
|
||||||
|
|
|
@ -8,6 +8,6 @@ import filter from './TravelFilter.js';
|
||||||
data-key="Travel"
|
data-key="Travel"
|
||||||
url="Travels"
|
url="Travels"
|
||||||
:descriptor="TravelDescriptor"
|
:descriptor="TravelDescriptor"
|
||||||
:filter="filter"
|
:filter="{ ...filter, where: { id: $route.params.id } }"
|
||||||
/>
|
/>
|
||||||
</template>
|
</template>
|
||||||
|
|
|
@ -410,18 +410,18 @@ onMounted(async () => {
|
||||||
</template>
|
</template>
|
||||||
</QTable>
|
</QTable>
|
||||||
</QCard>
|
</QCard>
|
||||||
|
|
||||||
<QCard class="full-width" v-if="thermographs.length > 0">
|
<QCard class="full-width" v-if="thermographs.length > 0">
|
||||||
<RouterLink
|
<FetchData
|
||||||
class="header header-link"
|
url="Warehouses"
|
||||||
:to="{
|
:filter="{ fields: ['id', 'name'] }"
|
||||||
name: 'TravelThermographsIndex',
|
order="name"
|
||||||
params: { id: travel.id },
|
@on-fetch="(data) => (warehouses = data)"
|
||||||
}"
|
auto-load
|
||||||
>
|
/>
|
||||||
{{ t('travel.summary.thermographs') }}
|
<VnTitle
|
||||||
<QIcon name="open_in_new" />
|
:url="getLink('thermographs')"
|
||||||
</RouterLink>
|
:text="t('travel.summary.thermographs')"
|
||||||
|
/>
|
||||||
<QTable
|
<QTable
|
||||||
:rows="thermographs"
|
:rows="thermographs"
|
||||||
:columns="thermographsTableColumns"
|
:columns="thermographsTableColumns"
|
||||||
|
|
|
@ -102,8 +102,11 @@ en:
|
||||||
lastName: Last name
|
lastName: Last name
|
||||||
userName: User
|
userName: User
|
||||||
extension: Extension
|
extension: Extension
|
||||||
|
departmentFk: Department
|
||||||
es:
|
es:
|
||||||
|
|
||||||
params:
|
params:
|
||||||
|
departmentFk: Departamento
|
||||||
search: Contiene
|
search: Contiene
|
||||||
firstName: Nombre
|
firstName: Nombre
|
||||||
lastName: Apellidos
|
lastName: Apellidos
|
||||||
|
|
|
@ -1,4 +1,4 @@
|
||||||
describe('ClaimNotes', () => {
|
describe('Account descriptor', () => {
|
||||||
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
const descriptorOptions = '[data-cy="descriptor-more-opts-menu"] > .q-list';
|
||||||
const url = '/#/account/1/summary';
|
const url = '/#/account/1/summary';
|
||||||
|
|
||||||
|
@ -7,6 +7,9 @@ describe('ClaimNotes', () => {
|
||||||
cy.visit(url);
|
cy.visit(url);
|
||||||
cy.dataCy('descriptor-more-opts').click();
|
cy.dataCy('descriptor-more-opts').click();
|
||||||
cy.get(descriptorOptions)
|
cy.get(descriptorOptions)
|
||||||
|
.should('exist')
|
||||||
|
.should('be.visible')
|
||||||
|
|
||||||
.find('.q-item')
|
.find('.q-item')
|
||||||
.its('length')
|
.its('length')
|
||||||
.then((count) => {
|
.then((count) => {
|
||||||
|
|
|
@ -30,9 +30,11 @@ describe('OrderList', () => {
|
||||||
cy.url().should('include', `/order`);
|
cy.url().should('include', `/order`);
|
||||||
});
|
});
|
||||||
|
|
||||||
it.skip('filter list and create order', () => {
|
it('filter list and create order', () => {
|
||||||
cy.dataCy('Customer ID_input').type('1101{enter}');
|
cy.dataCy('Customer ID_input').type('1101{enter}');
|
||||||
|
cy.intercept('GET', /\/api\/Clients/).as('clientFilter');
|
||||||
cy.dataCy('vnTableCreateBtn').click();
|
cy.dataCy('vnTableCreateBtn').click();
|
||||||
|
cy.wait('@clientFilter');
|
||||||
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
cy.dataCy('landedDate').find('input').type('06/01/2001');
|
||||||
cy.selectOption(agencyCreateSelect, 1);
|
cy.selectOption(agencyCreateSelect, 1);
|
||||||
|
|
||||||
|
|
|
@ -1,37 +0,0 @@
|
||||||
describe('VnAccountNumber', () => {
|
|
||||||
const accountInput = 'input[data-cy="supplierFiscalDataAccount_input"]';
|
|
||||||
beforeEach(() => {
|
|
||||||
cy.login('developer');
|
|
||||||
cy.viewport(1920, 1080);
|
|
||||||
cy.visit('/#/supplier/1/fiscal-data');
|
|
||||||
});
|
|
||||||
|
|
||||||
describe('VnInput handleInsertMode()', () => {
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
cy.get(accountInput).type('{selectall}4100000001');
|
|
||||||
cy.get(accountInput).type('{movetostart}');
|
|
||||||
cy.get(accountInput).type('999');
|
|
||||||
cy.get(accountInput).should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should replace character at cursor position in insert mode', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('4100000001');
|
|
||||||
cy.get(accountInput).type('{movetostart}');
|
|
||||||
cy.get(accountInput).type('999');
|
|
||||||
cy.get(accountInput).should('have.value', '9990000001');
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should respect maxlength prop', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('123456789012345');
|
|
||||||
cy.get(accountInput).should('have.value', '1234567890');
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
|
||||||
it('should convert short account number to standard format', () => {
|
|
||||||
cy.get(accountInput).clear();
|
|
||||||
cy.get(accountInput).type('123.');
|
|
||||||
cy.get(accountInput).should('have.value', '1230000000');
|
|
||||||
});
|
|
||||||
});
|
|
Loading…
Reference in New Issue