fix test
gitea/salix/pipeline/head This commit looks good
Details
gitea/salix/pipeline/head This commit looks good
Details
This commit is contained in:
parent
d80d520fba
commit
930e167a8e
|
@ -17,9 +17,13 @@ describe('claim', () => {
|
||||||
$httpBackend = _$httpBackend_;
|
$httpBackend = _$httpBackend_;
|
||||||
$httpBackend.whenGET('Claims/ClaimBeginnings').respond({});
|
$httpBackend.whenGET('Claims/ClaimBeginnings').respond({});
|
||||||
$httpBackend.whenGET(`Tickets/1/isEditable`).respond(true);
|
$httpBackend.whenGET(`Tickets/1/isEditable`).respond(true);
|
||||||
|
$httpBackend.whenGET(`Claims/2/isEditable`).respond(true);
|
||||||
const $element = angular.element('<vn-claim-detail></vn-claim-detail>');
|
const $element = angular.element('<vn-claim-detail></vn-claim-detail>');
|
||||||
controller = $componentController('vnClaimDetail', {$element, $scope});
|
controller = $componentController('vnClaimDetail', {$element, $scope});
|
||||||
controller.claim = {ticketFk: 1};
|
controller.claim = {
|
||||||
|
ticketFk: 1,
|
||||||
|
id: 2}
|
||||||
|
;
|
||||||
controller.salesToClaim = [{saleFk: 1}, {saleFk: 2}];
|
controller.salesToClaim = [{saleFk: 1}, {saleFk: 2}];
|
||||||
controller.salesClaimed = [{id: 1, sale: {}}];
|
controller.salesClaimed = [{id: 1, sale: {}}];
|
||||||
controller.$.model = crudModel;
|
controller.$.model = crudModel;
|
||||||
|
@ -125,9 +129,9 @@ describe('claim', () => {
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
describe('isClaimEditable()', () => {
|
describe('isTicketEditable()', () => {
|
||||||
it('should check if the claim is editable', () => {
|
it('should check if the ticket assigned to the claim is editable', () => {
|
||||||
controller.isClaimEditable();
|
controller.isTicketEditable();
|
||||||
$httpBackend.flush();
|
$httpBackend.flush();
|
||||||
|
|
||||||
expect(controller.isEditable).toBeTruthy();
|
expect(controller.isEditable).toBeTruthy();
|
||||||
|
|
Loading…
Reference in New Issue