2018-08-01 07:47:34 +00:00
|
|
|
/* import './index.js';
|
2018-05-16 06:13:39 +00:00
|
|
|
|
|
|
|
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
|
|
|
|
};
|
2018-08-01 07:47:34 +00:00
|
|
|
|
2018-05-16 06:13:39 +00:00
|
|
|
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();
|
|
|
|
});
|
|
|
|
});
|
|
|
|
});
|
2018-08-01 07:47:34 +00:00
|
|
|
}); */
|