From ab5ed6f2ece6271fc3f304d64231fea3587fcb23 Mon Sep 17 00:00:00 2001 From: Marc Laval Date: Thu, 19 Mar 2015 14:21:45 +0100 Subject: [PATCH] chore(test): clean tests of if directive Closes #1017 --- modules/angular2/test/directives/if_spec.js | 39 +-------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/modules/angular2/test/directives/if_spec.js b/modules/angular2/test/directives/if_spec.js index 3e753857c4..edbc116a4a 100644 --- a/modules/angular2/test/directives/if_spec.js +++ b/modules/angular2/test/directives/if_spec.js @@ -145,40 +145,7 @@ export function main() { })); - if (!IS_DARTIUM) { - it('should leave the element if the condition is a non-empty string (JS)', inject([AsyncTestCompleter], (async) => { - compileWithTemplate('
hello
').then((pv) => { - createView(pv); - cd.detectChanges(); - - expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(1); - expect(DOM.getText(view.nodes[0])).toEqual('hello'); - async.done(); - }); - })); - - it('should leave the element if the condition is an object (JS)', inject([AsyncTestCompleter], (async) => { - compileWithTemplate('
hello
').then((pv) => { - createView(pv); - cd.detectChanges(); - - expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(1); - expect(DOM.getText(view.nodes[0])).toEqual('hello'); - async.done(); - }); - })); - - it('should remove the element if the condition is null (JS)', inject([AsyncTestCompleter], (async) => { - compileWithTemplate('
hello
').then((pv) => { - createView(pv); - cd.detectChanges(); - - expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(0); - expect(DOM.getText(view.nodes[0])).toEqual(''); - async.done(); - }); - })); - + if (!IS_DARTIUM) {; it('should not add the element twice if the condition goes from true to true (JS)', inject([AsyncTestCompleter], (async) => { compileWithTemplate('
hello
').then((pv) => { createView(pv); @@ -231,8 +198,6 @@ class TestComponent { numberCondition: number; stringCondition: string; functionCondition: Function; - objectCondition: any; - nullCondition: any; constructor() { this.booleanCondition = true; this.numberCondition = 1; @@ -240,7 +205,5 @@ class TestComponent { this.functionCondition = function(s, n){ return s == "foo" && n == 1; }; - this.objectCondition = {}; - this.nullCondition = null; } }