This commit is contained in:
parent
12acda0b1c
commit
79d88facc3
|
@ -32,7 +32,6 @@
|
||||||
vn-acl="invoicing, claimManager, salesAssistant"
|
vn-acl="invoicing, claimManager, salesAssistant"
|
||||||
vn-acl-action="remove">
|
vn-acl-action="remove">
|
||||||
</vn-button>
|
</vn-button>
|
||||||
{{ $ctrl.checkeds }}
|
|
||||||
</vn-button-bar>
|
</vn-button-bar>
|
||||||
<vn-horizontal ng-repeat="service in $ctrl.services">
|
<vn-horizontal ng-repeat="service in $ctrl.services">
|
||||||
<vn-check
|
<vn-check
|
||||||
|
|
|
@ -19,12 +19,11 @@ describe('Ticket component vnTicketService', () => {
|
||||||
|
|
||||||
describe('getDefaultTaxClass', () => {
|
describe('getDefaultTaxClass', () => {
|
||||||
it('should set the default tax class in the controller', () => {
|
it('should set the default tax class in the controller', () => {
|
||||||
$httpBackend.whenRoute('GET', `TaxClasses/findOne`)
|
$httpBackend.whenRoute('GET', `TaxClasses/findOne`).respond({
|
||||||
.respond({
|
id: 4000,
|
||||||
id: 4000,
|
name: 'Whatever',
|
||||||
name: 'Whatever',
|
code: 'GG',
|
||||||
code: 'GG'
|
});
|
||||||
});
|
|
||||||
controller.getDefaultTaxClass();
|
controller.getDefaultTaxClass();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
|
@ -49,15 +48,15 @@ describe('Ticket component vnTicketService', () => {
|
||||||
it('should set the description of the selected service upon service type creation', () => {
|
it('should set the description of the selected service upon service type creation', () => {
|
||||||
const service = {
|
const service = {
|
||||||
id: 1,
|
id: 1,
|
||||||
quantity: 10
|
quantity: 10,
|
||||||
};
|
};
|
||||||
$scope.newServiceType = {
|
$scope.newServiceType = {
|
||||||
name: 'Totally new stuff'
|
name: 'Totally new stuff',
|
||||||
};
|
};
|
||||||
|
|
||||||
$httpBackend.when('POST', 'TicketServiceTypes').respond({
|
$httpBackend.when('POST', 'TicketServiceTypes').respond({
|
||||||
id: 4001,
|
id: 4001,
|
||||||
name: 'Totally new stuff'
|
name: 'Totally new stuff',
|
||||||
});
|
});
|
||||||
controller.onNewServiceTypeAccept(service);
|
controller.onNewServiceTypeAccept(service);
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
@ -65,4 +64,20 @@ describe('Ticket component vnTicketService', () => {
|
||||||
expect(service.ticketServiceTypeFk).toEqual(4001);
|
expect(service.ticketServiceTypeFk).toEqual(4001);
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
describe('addChecked', () => {
|
||||||
|
it('should add an item to the checkeds array', () => {
|
||||||
|
controller.checkeds = [];
|
||||||
|
controller.addChecked(1);
|
||||||
|
|
||||||
|
expect(controller.checkeds).toEqual([1]);
|
||||||
|
});
|
||||||
|
|
||||||
|
it('should remove an item if it is already in the checkeds array', () => {
|
||||||
|
controller.checkeds = [1, 2, 3];
|
||||||
|
controller.addChecked(2);
|
||||||
|
|
||||||
|
expect(controller.checkeds).toEqual([1, 3]);
|
||||||
|
});
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
|
Loading…
Reference in New Issue