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