test(ivy): re-enable ngIf protractor test (#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 #28845
This commit is contained in:
Kara Erickson 2019-02-19 14:12:35 -08:00 committed by Igor Minar
parent 71d0eeb966
commit eb39633823
2 changed files with 13 additions and 15 deletions

View File

@ -46,8 +46,7 @@ describe('ngIf', () => {
describe('ng-if-then-else', () => { describe('ng-if-then-else', () => {
let comp = 'ng-if-then-else'; let comp = 'ng-if-then-else';
modifiedInIvy('FW-1019: Design new API to replace static queries') it('should hide/show content', () => {
.it('should hide/show content', () => {
browser.get(URL); browser.get(URL);
waitForElement(comp); waitForElement(comp);
expect(element.all(by.css(comp)).get(0).getText()) expect(element.all(by.css(comp)).get(0).getText())
@ -57,8 +56,7 @@ describe('ngIf', () => {
.toEqual('hideSwitch Primary show = true\nSecondary text to show'); .toEqual('hideSwitch Primary show = true\nSecondary text to show');
element.all(by.css(comp + ' button')).get(0).click(); element.all(by.css(comp + ' button')).get(0).click();
expect(element.all(by.css(comp)).get(0).getText()) expect(element.all(by.css(comp)).get(0).getText())
.toEqual( .toEqual('showSwitch Primary show = false\nAlternate text while primary text is hidden');
'showSwitch Primary show = false\nAlternate text while primary text is hidden');
}); });
}); });

View File

@ -60,7 +60,7 @@ export class NgIfThenElse implements OnInit {
thenBlock: TemplateRef<any>|null = null; thenBlock: TemplateRef<any>|null = null;
show: boolean = true; show: boolean = true;
@ViewChild('primaryBlock') @ViewChild('primaryBlock', {static: true})
primaryBlock: TemplateRef<any>|null = null; primaryBlock: TemplateRef<any>|null = null;
@ViewChild('secondaryBlock') @ViewChild('secondaryBlock')
secondaryBlock: TemplateRef<any>|null = null; secondaryBlock: TemplateRef<any>|null = null;