refactor(test): adapted the new thermograph front unit test to expect thermograph data to be defined

This commit is contained in:
Carlos Jimenez Ruiz 2021-10-19 11:08:03 +02:00
parent e3942c0bb9
commit 5be2eb974f
1 changed files with 18 additions and 2 deletions

View File

@ -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();