#476 web-access/index.js Front unit test

This commit is contained in:
Carlos Jimenez 2018-08-08 09:05:31 +02:00
parent a694cd4b7a
commit 34f0f4c853
1 changed files with 15 additions and 0 deletions

View File

@ -44,6 +44,21 @@ describe('Component VnClientWebAccess', () => {
}); });
}); });
describe('checkConditions()', () => {
it(`should perform a query to check if the client is valid and then store a boolean into the controller`, () => {
controller.client = {id: '1234'};
expect(controller.canEnableCheckBox).toBeTruthy();
$httpBackend.when('GET', `/client/api/Clients/${controller.client.id}/isValidClient`).respond(false);
$httpBackend.expectGET(`/client/api/Clients/${controller.client.id}/isValidClient`);
controller.checkConditions();
$httpBackend.flush();
expect(controller.canEnableCheckBox).toBeFalsy();
});
});
describe('onPassOpen()', () => { describe('onPassOpen()', () => {
it('should set passwords to empty values', () => { it('should set passwords to empty values', () => {
controller.newPassword = 'm24x8'; controller.newPassword = 'm24x8';