salix/client/ticket/src/data/step-three/step-three.spec.js

51 lines
1.7 KiB
JavaScript
Raw Normal View History

/* import './step-three.js';
describe('ticket', () => {
describe('Component vnTicketDataStepThree', () => {
let $componentController;
let $state;
let controller;
let $httpBackend;
beforeEach(() => {
angular.mock.module('ticket');
});
beforeEach(angular.mock.inject((_$componentController_, _$state_, _$httpBackend_) => {
$componentController = _$componentController_;
$state = _$state_;
$httpBackend = _$httpBackend_;
controller = $componentController('vnTicketDataStepThree', {$state: $state});
}));
describe('onSubmit()', () => {
it('should call onSubmit()', () => {
controller.ticket = {
id: 1,
agencyModeFk: 1,
addressFk: 121,
warehouseFk: 1,
shipped: Date.now(),
landed: Date.now(),
option: 1
};
let data = {
agencyModeFk: 1,
addressFk: 121,
warehouseFk: 1,
shipped: Date.now(),
landed: Date.now(),
option: 1
};
let response = {data: {error: {message: 'NOTHING_HERE'}}};
$httpBackend.whenPOST(`/ticket/api/tickets/1/componentUpdate`, data).respond(400, response);
$httpBackend.expectPOST(`/ticket/api/tickets/1/componentUpdate`, data);
controller.onSubmit();
$httpBackend.flush();
});
});
});
}); */