Updated unit tests
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
78507240ee
commit
e618423ef8
|
@ -59,7 +59,7 @@ describe('entry import()', () => {
|
|||
|
||||
expect(updatedEntry.observation).toEqual(expectedObservation);
|
||||
expect(updatedEntry.ref).toEqual(expectedRef);
|
||||
expect(entryBuys.length).toEqual(2);
|
||||
expect(entryBuys.length).toEqual(4);
|
||||
|
||||
await tx.rollback();
|
||||
} catch (e) {
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
const models = require('vn-loopback/server/server').models;
|
||||
|
||||
describe('Entry lastItemBuys()', () => {
|
||||
const entryId = 3;
|
||||
it('should return the items that have been bought', async() => {
|
||||
const filter = {where: {}};
|
||||
const result = await models.Entry.lastItemBuys(entryId, filter);
|
||||
|
||||
expect(result.length).toBeGreaterThan(1);
|
||||
});
|
||||
|
||||
it('should return the items matching color "brown"', async() => {
|
||||
const brownInkCode = 'BRW';
|
||||
const filter = {where: {inkFk: brownInkCode}};
|
||||
const result = await models.Entry.lastItemBuys(entryId, filter);
|
||||
|
||||
expect(result.length).toEqual(2);
|
||||
});
|
||||
|
||||
it('should return the items with a name containing "Ranged"', async() => {
|
||||
const filter = {where: {name: {like: '%Ranged%'}}};
|
||||
const result = await models.Entry.lastItemBuys(entryId, filter);
|
||||
|
||||
expect(result.length).toEqual(3);
|
||||
});
|
||||
});
|
|
@ -128,7 +128,7 @@ class Controller extends Section {
|
|||
|
||||
switch (key) {
|
||||
case 'name':
|
||||
where['i.name'] = {like: `%${value}%`};
|
||||
where[key] = {like: `%${value}%`};
|
||||
break;
|
||||
case 'producerFk':
|
||||
case 'typeFk':
|
||||
|
|
|
@ -20,7 +20,7 @@
|
|||
on-change="$ctrl.changeState(value)">
|
||||
</vn-button-menu>
|
||||
<vn-ticket-descriptor-menu
|
||||
ng-if="!$ctrl.isTicketModule"
|
||||
ng-if="!$ctrl.isOnTicketCard"
|
||||
ticket-id="$ctrl.summary.id"
|
||||
parent-reload="$ctrl.reload()"
|
||||
/>
|
||||
|
|
|
@ -41,9 +41,9 @@ class Controller extends Summary {
|
|||
});
|
||||
}
|
||||
|
||||
get isTicketModule() {
|
||||
const path = this.$state.getCurrentPath()[1];
|
||||
return path.state.name === 'ticket';
|
||||
get isOnTicketCard() {
|
||||
const currentState = this.$state.current.name;
|
||||
return currentState.startsWith('ticket.card');
|
||||
}
|
||||
|
||||
get isEditable() {
|
||||
|
|
|
@ -5,9 +5,7 @@ clientData: 'Tus datos para poder comprar en la web de Verdnatura (<a href="http
|
|||
title="Visitar Verdnatura" target="_blank" style="color: #8dba25">https://www.verdnatura.es</a>)
|
||||
o en nuestras aplicaciones para <a href="https://goo.gl/3hC2mG" title="App Store"
|
||||
target="_blank" style="color: #8dba25">iOS</a> y <a href="https://goo.gl/8obvLc"
|
||||
title="Google Play" target="_blank" style="color: #8dba25">Android</a> (<a
|
||||
href="https://www.youtube.com/watch?v=gGfEtFm8qkw" target="_blank" style="color:
|
||||
#8dba25"><strong>Ver tutorial de uso</strong></a>), son'
|
||||
title="Google Play" target="_blank" style="color: #8dba25">Android</a>, son'
|
||||
clientId: Identificador de cliente
|
||||
user: Usuario
|
||||
password: Contraseña
|
||||
|
|
Loading…
Reference in New Issue