#476 web-access/index.js Front unit test
This commit is contained in:
parent
a694cd4b7a
commit
34f0f4c853
|
@ -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';
|
||||||
|
|
Loading…
Reference in New Issue