Skip to content

Commit ab5ed6f

Browse files
committed
chore(test): clean tests of if directive
Closes angular#1017
1 parent 0f20c39 commit ab5ed6f

File tree

1 file changed

+1
-38
lines changed

1 file changed

+1
-38
lines changed

modules/angular2/test/directives/if_spec.js

Lines changed: 1 addition & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -145,40 +145,7 @@ export function main() {
145145
}));
146146

147147

148-
if (!IS_DARTIUM) {
149-
it('should leave the element if the condition is a non-empty string (JS)', inject([AsyncTestCompleter], (async) => {
150-
compileWithTemplate('<div><copy-me template="if stringCondition">hello</copy-me></div>').then((pv) => {
151-
createView(pv);
152-
cd.detectChanges();
153-
154-
expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(1);
155-
expect(DOM.getText(view.nodes[0])).toEqual('hello');
156-
async.done();
157-
});
158-
}));
159-
160-
it('should leave the element if the condition is an object (JS)', inject([AsyncTestCompleter], (async) => {
161-
compileWithTemplate('<div><copy-me template="if objectCondition">hello</copy-me></div>').then((pv) => {
162-
createView(pv);
163-
cd.detectChanges();
164-
165-
expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(1);
166-
expect(DOM.getText(view.nodes[0])).toEqual('hello');
167-
async.done();
168-
});
169-
}));
170-
171-
it('should remove the element if the condition is null (JS)', inject([AsyncTestCompleter], (async) => {
172-
compileWithTemplate('<div><copy-me template="if nullCondition">hello</copy-me></div>').then((pv) => {
173-
createView(pv);
174-
cd.detectChanges();
175-
176-
expect(DOM.querySelectorAll(view.nodes[0], 'copy-me').length).toEqual(0);
177-
expect(DOM.getText(view.nodes[0])).toEqual('');
178-
async.done();
179-
});
180-
}));
181-
148+
if (!IS_DARTIUM) {;
182149
it('should not add the element twice if the condition goes from true to true (JS)', inject([AsyncTestCompleter], (async) => {
183150
compileWithTemplate('<div><copy-me template="if numberCondition">hello</copy-me></div>').then((pv) => {
184151
createView(pv);
@@ -231,16 +198,12 @@ class TestComponent {
231198
numberCondition: number;
232199
stringCondition: string;
233200
functionCondition: Function;
234-
objectCondition: any;
235-
nullCondition: any;
236201
constructor() {
237202
this.booleanCondition = true;
238203
this.numberCondition = 1;
239204
this.stringCondition = "foo";
240205
this.functionCondition = function(s, n){
241206
return s == "foo" && n == 1;
242207
};
243-
this.objectCondition = {};
244-
this.nullCondition = null;
245208
}
246209
}

0 commit comments

Comments
 (0)