#1247 reparar tests excluidos
gitea/salix/dev This commit looks good Details

This commit is contained in:
Gerard 2019-04-05 07:52:08 +02:00
parent cfdeb387a1
commit 00b7442b89
6 changed files with 35 additions and 16 deletions

View File

@ -135,10 +135,6 @@ module.exports = Self => {
newRefundTicket.id, claim.ticketFk
], {transaction: transaction});
let claimState = await Self.app.models.ClaimState.findOne({where: {description: 'Resuelto'}});
await claim.updateAttribute('claimStateFk', claimState.id, {transaction: transaction});
await transaction.commit();
return newRefundTicket;

View File

@ -1,6 +1,6 @@
const app = require('vn-loopback/server/server');
// xcluded waiting for fixtures
xdescribe('claimBeginning', () => {
describe('claimBeginning', () => {
let ticket;
let refundTicketObservations;
let refundTicketSales;

View File

@ -1,6 +1,6 @@
const app = require('vn-loopback/server/server');
// xcluded waiting for fixtures
xdescribe('regularizeClaim()', () => {
describe('regularizeClaim()', () => {
const claimFk = 1;
const pendentState = 1;
const resolvedState = 3;

View File

@ -1,10 +1,10 @@
const app = require('vn-loopback/server/server');
xdescribe('client getDebt()', () => {
it('should return the client debt', async () => {
describe('client getDebt()', () => {
it('should return the client debt', async() => {
let result = await app.models.Client.getDebt(101);
expect(result.debt).toEqual(579.1);
expect(result.debt).toEqual(329.13);
});
});

View File

@ -1,6 +1,6 @@
import './card.js';
xdescribe('Order', () => {
describe('Order', () => {
describe('Component vnOrderCreateCard', () => {
let controller;
let $httpBackend;
@ -22,11 +22,30 @@ xdescribe('Order', () => {
});
describe('set clientFk', () => {
it(`should set addressFk to null and clientFk to a value`, () => {
it(`should set addressFk to null and clientFk to a value and set addressFk to a value given`, () => {
let filter = {
include: {
relation: 'defaultAddress',
scope: {
fields: 'id'
}
},
where: {id: 2}
};
filter = encodeURIComponent(JSON.stringify(filter));
let response = [
{
defaultAddress: {id: 1}
}
];
$httpBackend.whenGET(`/api/Clients?filter=${filter}`).respond(response);
$httpBackend.expectGET(`/api/Clients?filter=${filter}`);
controller.clientFk = 2;
$httpBackend.flush();
expect(controller.clientFk).toEqual(2);
expect(controller.order.addressFk).toBe(null);
expect(controller.order.addressFk).toBe(1);
});
});

View File

@ -1,6 +1,7 @@
import './index.js';
import watcher from 'core/mocks/watcher';
xdescribe('Order', () => {
describe('Order', () => {
describe('Component vnOrderLine', () => {
let $state;
let controller;
@ -14,6 +15,7 @@ xdescribe('Order', () => {
$httpBackend = _$httpBackend_;
controller = $componentController('vnOrderLine', {$state});
controller.rows = [{id: 1}];
controller.$scope.watcher = watcher;
controller.$scope.popover = {relocate: () => {}};
controller.$scope.descriptor = {show: () => {}};
controller.vnApp = {showSuccess: () => {}};
@ -50,14 +52,16 @@ xdescribe('Order', () => {
expect(controller.rows.length).toBe(1);
spyOn(controller.vnApp, 'showSuccess');
spyOn(controller, 'getVAT');
spyOn(controller.card, 'reload');
controller.deleteRow('ACCEPT');
$httpBackend.expectPOST(`/order/api/OrderRows/removes`).respond();
$httpBackend.flush();
expect(controller.vnApp.showSuccess).toHaveBeenCalledWith('Data saved!');
expect(controller.card.reload).toHaveBeenCalledWith();
expect(controller.rows.length).toBe(0);
expect(controller.idsToRemove).toBe(undefined);
expect(controller.lineIdToRemove).toBe(undefined);
});
});