From 5be2eb974f9d03328ebed6c589a59e727829b7aa Mon Sep 17 00:00:00 2001 From: carlosjr Date: Tue, 19 Oct 2021 11:08:03 +0200 Subject: [PATCH] refactor(test): adapted the new thermograph front unit test to expect thermograph data to be defined --- .../front/thermograph/create/index.spec.js | 20 +++++++++++++++++-- 1 file changed, 18 insertions(+), 2 deletions(-) diff --git a/modules/travel/front/thermograph/create/index.spec.js b/modules/travel/front/thermograph/create/index.spec.js index c2b94d3e84..1ad263d31f 100644 --- a/modules/travel/front/thermograph/create/index.spec.js +++ b/modules/travel/front/thermograph/create/index.spec.js @@ -79,8 +79,24 @@ describe('Ticket', () => { }); describe('onNewThermographAccept()', () => { - it('should set the created thermograph id on to the controller for the autocomplete to use it', () => { - const response = {id: 'the created id'}; + it('should set the created thermograph data on to the controller for the autocomplete to use it', () => { + const id = 'the created id'; + const warehouseId = 1; + const temperatureId = 'cool'; + const model = 'my model'; + + controller.newThermograph = { + thermographId: id, + warehouseId: warehouseId, + temperatureFk: temperatureId, + model: model + }; + const response = { + id: id, + warehouseId: warehouseId, + temperatureFk: temperatureId, + model: model + }; $httpBackend.when('POST', `Thermographs/createThermograph`).respond(response); controller.onNewThermographAccept(); $httpBackend.flush();