From 020fd3024339af229b0da2799ee3d2d5388ff4e0 Mon Sep 17 00:00:00 2001 From: Bernat Exposito Domenech Date: Wed, 26 Feb 2020 08:57:51 +0100 Subject: [PATCH] fix crud model test --- front/core/components/crud-model/index.spec.js | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/front/core/components/crud-model/index.spec.js b/front/core/components/crud-model/index.spec.js index 8233c5992..503d43484 100644 --- a/front/core/components/crud-model/index.spec.js +++ b/front/core/components/crud-model/index.spec.js @@ -181,29 +181,31 @@ describe('Component vnCrudModel', () => { it('should check onRequestEnd is called, moreRows is true and currentFilter is undefined when append is true', () => { spyOn(controller, 'onRequestEnd'); + const append = true; const json = {data: [ { id: 1, name: 'test' }]}; const filter = {limit: 1}; - controller.onRemoteDone(json, filter, true); + controller.onRemoteDone(json, filter, append); expect(controller.moreRows).toBe(true); - expect(controller.filter).toBeUndefined(); + expect(controller.currentFilter).toBeUndefined(); expect(controller.onRequestEnd).toHaveBeenCalledWith(); }); it('should check onRequestEnd is called, moreRows is true and currentFilter is defined when append is false', () => { spyOn(controller, 'onRequestEnd'); + const append = false; const json = {data: [ { id: 1, name: 'test' }]}; const filter = {limit: 1}; - controller.onRemoteDone(json, filter, false); + controller.onRemoteDone(json, filter, append); expect(controller.moreRows).toBe(true); expect(controller.currentFilter).toBe(filter);