Skip to content

Commit 8fe8677

Browse files
committed
test: fix unit tests for renderer
1 parent e1a21e9 commit 8fe8677

File tree

1 file changed

+19
-20
lines changed

1 file changed

+19
-20
lines changed

tests/app/tests/renderer-tests.ts

Lines changed: 19 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -291,7 +291,7 @@ describe("Renderer E2E", () => {
291291
it("ngIf hides component when false", () => {
292292
return testApp.loadComponent(NgIfLabel).then((componentRef) => {
293293
const componentRoot = componentRef.instance.elementRef.nativeElement;
294-
assert.equal("(ProxyViewContainer (CommentNode))", dumpView(componentRoot));
294+
assert.equal("(ProxyViewContainer)", dumpView(componentRoot));
295295
});
296296
});
297297

@@ -302,7 +302,7 @@ describe("Renderer E2E", () => {
302302

303303
component.show = true;
304304
testApp.appRef.tick();
305-
assert.equal("(ProxyViewContainer (CommentNode), (Label))", dumpView(componentRoot));
305+
assert.equal("(ProxyViewContainer, (Label))", dumpView(componentRoot));
306306
});
307307
});
308308

@@ -314,12 +314,11 @@ describe("Renderer E2E", () => {
314314
component.show = true;
315315
testApp.appRef.tick();
316316
assert.equal(
317-
"(ProxyViewContainer (StackLayout (CommentNode), (Label), (Button)))",
317+
"(ProxyViewContainer (StackLayout (Label), (Button)))",
318318
dumpView(componentRoot));
319319
});
320320
});
321321

322-
323322
it("ngIf shows elements in correct order when multiple are rendered and there's *ngIf", () => {
324323
return testApp.loadComponent(NgIfMultiple).then((componentRef) => {
325324
const component = <NgIfMultiple>componentRef.instance;
@@ -333,8 +332,7 @@ describe("Renderer E2E", () => {
333332
"(Label[text=1]), " +
334333
"(Label[text=2]), " +
335334
"(Label[text=3]), " +
336-
"(CommentNode), " + // ng-reflect comment
337-
"(Label[text=4]), " + // the content to be displayed and its anchor
335+
"(Label[text=4]), " + // the content to be conditionally displayed
338336
"(Label[text=5])" +
339337
")" +
340338
")",
@@ -351,9 +349,9 @@ describe("Renderer E2E", () => {
351349
assert.equal(
352350
"(ProxyViewContainer " +
353351
"(StackLayout " +
354-
"(CommentNode), " + // ng-reflect comment
355-
"(Label[text=If]), (CommentNode)))", // the content to be displayed and its anchor
356-
352+
"(Label[text=If])", +
353+
")" +
354+
")",
357355
dumpView(componentRoot, true));
358356
});
359357
});
@@ -368,8 +366,9 @@ describe("Renderer E2E", () => {
368366
assert.equal(
369367
"(ProxyViewContainer " +
370368
"(StackLayout " +
371-
"(CommentNode), " + // ng-reflect comment
372-
"(Label[text=Else]), (CommentNode)))", // the content to be displayed and its anchor
369+
"(Label[text=Else])" +
370+
")" +
371+
")",
373372

374373
dumpView(componentRoot, true));
375374
});
@@ -384,9 +383,9 @@ describe("Renderer E2E", () => {
384383
assert.equal(
385384
"(ProxyViewContainer " +
386385
"(StackLayout " +
387-
"(CommentNode), " + // ng-reflect comment
388-
"(Label[text=Then]), (CommentNode), " + // the content to be displayed and its anchor
389-
"(CommentNode)))", // the anchor for the else template
386+
"(Label[text=Then])" +
387+
")" +
388+
")",
390389

391390
dumpView(componentRoot, true));
392391
});
@@ -403,9 +402,9 @@ describe("Renderer E2E", () => {
403402
assert.equal(
404403
"(ProxyViewContainer " +
405404
"(StackLayout " +
406-
"(CommentNode), " + // the content to be displayed
407-
"(Label[text=Else]), (CommentNode), " + // the content to be displayed
408-
"(CommentNode)))", // the content to be displayed
405+
"(Label[text=Else])" +
406+
")" +
407+
")",
409408

410409
dumpView(componentRoot, true));
411410
});
@@ -415,7 +414,7 @@ describe("Renderer E2E", () => {
415414
return testApp.loadComponent(NgForLabel).then((componentRef) => {
416415
const componentRoot = componentRef.instance.elementRef.nativeElement;
417416
assert.equal(
418-
"(ProxyViewContainer (CommentNode), (Label[text=one]), (Label[text=two]), (Label[text=three]))",
417+
"(ProxyViewContainer (Label[text=one]), (Label[text=two]), (Label[text=three]))",
419418
dumpView(componentRoot, true));
420419
});
421420
});
@@ -429,7 +428,7 @@ describe("Renderer E2E", () => {
429428
testApp.appRef.tick();
430429

431430
assert.equal(
432-
"(ProxyViewContainer (CommentNode), (Label[text=one]), (Label[text=three]))",
431+
"(ProxyViewContainer (Label[text=one]), (Label[text=three]))",
433432
dumpView(componentRoot, true));
434433
});
435434
});
@@ -443,7 +442,7 @@ describe("Renderer E2E", () => {
443442
testApp.appRef.tick();
444443

445444
assert.equal(
446-
"(ProxyViewContainer (CommentNode), " +
445+
"(ProxyViewContainer " +
447446
"(Label[text=one]), (Label[text=new]), (Label[text=two]), (Label[text=three]))",
448447
dumpView(componentRoot, true));
449448
});

0 commit comments

Comments
 (0)