Skip to content

Commit eb39633

Browse files
karaIgorMinar
authored andcommitted
test(ivy): re-enable ngIf protractor test (angular#28845)
We previously disabled this test because we did not yet have static query support in Ivy and the planned API would be slightly different. Now that a static query flag is available that works in both View Engine and Ivy, the test has been updated to use that flag and has been turned on to run in CI. Since the test was always unrelated to queries and was intended to test *ngIf behavior, updating the test in this instance seems reasonable. PR Close angular#28845
1 parent 71d0eeb commit eb39633

File tree

2 files changed

+13
-15
lines changed

2 files changed

+13
-15
lines changed

packages/examples/common/ngIf/ts/e2e_test/ngIf_spec.ts

Lines changed: 12 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -46,20 +46,18 @@ describe('ngIf', () => {
4646
describe('ng-if-then-else', () => {
4747
let comp = 'ng-if-then-else';
4848

49-
modifiedInIvy('FW-1019: Design new API to replace static queries')
50-
.it('should hide/show content', () => {
51-
browser.get(URL);
52-
waitForElement(comp);
53-
expect(element.all(by.css(comp)).get(0).getText())
54-
.toEqual('hideSwitch Primary show = true\nPrimary text to show');
55-
element.all(by.css(comp + ' button')).get(1).click();
56-
expect(element.all(by.css(comp)).get(0).getText())
57-
.toEqual('hideSwitch Primary show = true\nSecondary text to show');
58-
element.all(by.css(comp + ' button')).get(0).click();
59-
expect(element.all(by.css(comp)).get(0).getText())
60-
.toEqual(
61-
'showSwitch Primary show = false\nAlternate text while primary text is hidden');
62-
});
49+
it('should hide/show content', () => {
50+
browser.get(URL);
51+
waitForElement(comp);
52+
expect(element.all(by.css(comp)).get(0).getText())
53+
.toEqual('hideSwitch Primary show = true\nPrimary text to show');
54+
element.all(by.css(comp + ' button')).get(1).click();
55+
expect(element.all(by.css(comp)).get(0).getText())
56+
.toEqual('hideSwitch Primary show = true\nSecondary text to show');
57+
element.all(by.css(comp + ' button')).get(0).click();
58+
expect(element.all(by.css(comp)).get(0).getText())
59+
.toEqual('showSwitch Primary show = false\nAlternate text while primary text is hidden');
60+
});
6361
});
6462

6563
describe('ng-if-let', () => {

packages/examples/common/ngIf/ts/module.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ export class NgIfThenElse implements OnInit {
6060
thenBlock: TemplateRef<any>|null = null;
6161
show: boolean = true;
6262

63-
@ViewChild('primaryBlock')
63+
@ViewChild('primaryBlock', {static: true})
6464
primaryBlock: TemplateRef<any>|null = null;
6565
@ViewChild('secondaryBlock')
6666
secondaryBlock: TemplateRef<any>|null = null;

0 commit comments

Comments
 (0)