From 12b33429533338c0084fc652deb203691522ae05 Mon Sep 17 00:00:00 2001 From: Carlos Jimenez <=> Date: Tue, 2 Jan 2018 08:17:40 +0100 Subject: [PATCH] validation Presence() unit tests for ng-invalid class --- client/core/src/directives/specs/validation.spec.js | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/client/core/src/directives/specs/validation.spec.js b/client/core/src/directives/specs/validation.spec.js index 3ff608a68..33fdbc6fd 100644 --- a/client/core/src/directives/specs/validation.spec.js +++ b/client/core/src/directives/specs/validation.spec.js @@ -55,10 +55,7 @@ describe('Directive validation', () => { let html = `
`; let validations = {User: {validations: {name: [{validation: 'presence'}]}}}; compile(html, validations, 'spiderman'); - scope.user.email = '1234?'; - - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); + scope.user.name = ''; scope.$digest(); expect(element[0].classList).toContain('ng-invalid'); @@ -70,9 +67,6 @@ describe('Directive validation', () => { let validations = {User: {validations: {email: [{validation: 'presence'}]}}}; compile(html, validations, 'user@verdnatura.es'); scope.user.email = 'user@verdnatura.es'; - - expect(element[0].classList).toContain('ng-valid'); - expect(element[0].classList).not.toContain('ng-invalid'); scope.$digest(); expect(element[0].classList).toContain('ng-valid');