ticketRequest front test
gitea/salix/2054-ticket_request_frontTest This commit looks good
Details
gitea/salix/2054-ticket_request_frontTest This commit looks good
Details
This commit is contained in:
parent
a3a7b4cbaa
commit
5cd3bde306
|
@ -89,6 +89,8 @@ class Controller {
|
|||
isEditable(isOk) {
|
||||
if (isOk != null)
|
||||
return true;
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -0,0 +1,62 @@
|
|||
import './index';
|
||||
|
||||
describe('Ticket', () => {
|
||||
describe('Component vnTicketRequestIndex', () => {
|
||||
let controller;
|
||||
let $scope;
|
||||
|
||||
beforeEach(ngModule('ticket'));
|
||||
|
||||
beforeEach(angular.mock.inject(($componentController, $rootScope) => {
|
||||
$scope = $rootScope.$new();
|
||||
|
||||
controller = $componentController('vnTicketRequestIndex', {$scope});
|
||||
}));
|
||||
|
||||
describe('getRequestState()', () => {
|
||||
it('should return New when the state is null', () => {
|
||||
let state = null;
|
||||
let result = controller.getRequestState(state);
|
||||
|
||||
expect(result).toEqual('New');
|
||||
});
|
||||
|
||||
it('should return Denied when the state is false', () => {
|
||||
let state = false;
|
||||
let result = controller.getRequestState(state);
|
||||
|
||||
expect(result).toEqual('Denied');
|
||||
});
|
||||
|
||||
it('should return Acepted when the state is true', () => {
|
||||
let state = true;
|
||||
let result = controller.getRequestState(state);
|
||||
|
||||
expect(result).toEqual('Acepted');
|
||||
});
|
||||
});
|
||||
|
||||
describe('isEditable()', () => {
|
||||
it('should return true when isOk is true', () => {
|
||||
let isOk = true;
|
||||
let result = controller.isEditable(isOk);
|
||||
|
||||
expect(result).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true when isOk is false', () => {
|
||||
let isOk = false;
|
||||
let result = controller.isEditable(isOk);
|
||||
|
||||
expect(result).toEqual(true);
|
||||
});
|
||||
|
||||
it('should return true when isOk is null', () => {
|
||||
let isOk = null;
|
||||
let result = controller.isEditable(isOk);
|
||||
|
||||
expect(result).toEqual(false);
|
||||
});
|
||||
});
|
||||
});
|
||||
});
|
|
@ -3,4 +3,5 @@ Atender: Comprador
|
|||
Remove request: Eliminar petición
|
||||
New request: Crear petición
|
||||
Sale id: Id linea
|
||||
Requester: Solicitante
|
||||
Requester: Solicitante
|
||||
New purchase request: Nueva petición de compra
|
Loading…
Reference in New Issue