#193 front end unit test for credit insurance list CR pending
This commit is contained in:
parent
27a08dc2a1
commit
7f274a24e6
|
@ -0,0 +1,32 @@
|
|||
import './credit-insurance-list';
|
||||
|
||||
describe('Client', () => {
|
||||
describe('Component vnClientCreditInsuranceList', () => {
|
||||
let $componentController;
|
||||
let controller;
|
||||
let $httpBackend;
|
||||
|
||||
beforeEach(() => {
|
||||
angular.mock.module('client');
|
||||
});
|
||||
|
||||
beforeEach(angular.mock.inject((_$componentController_, _$httpBackend_) => {
|
||||
$componentController = _$componentController_;
|
||||
let $state = {params: {classificationId: 1}};
|
||||
$httpBackend = _$httpBackend_;
|
||||
controller = $componentController('vnClientCreditInsuranceList', {$state: $state});
|
||||
}));
|
||||
|
||||
it('should perform a query to GET credit the credit classification', () => {
|
||||
let res = [{finished: 'some value'}];
|
||||
let query = '/client/api/CreditClassifications?filter=%7B%22fields%22%3A%5B%22finished%22%5D%2C%22where%22%3A%7B%22id%22%3A1%7D%7D';
|
||||
|
||||
$httpBackend.whenGET(query).respond(res);
|
||||
$httpBackend.expectGET(query);
|
||||
controller.$onInit();
|
||||
$httpBackend.flush();
|
||||
|
||||
expect(controller.isClosed).toBe(true);
|
||||
});
|
||||
});
|
||||
});
|
Loading…
Reference in New Issue