Skip to content

Commit

Permalink
test(ivy): turn on passing test in platform-browser (#28604)
Browse files Browse the repository at this point in the history
The behavior tested here was fixed by #28537, but I missed updating
the test in the original PR. This commit turns on the test to run
in Ivy mode, using "onlyInIvy" because the timing of the error message
is slightly different and requires CD to run.

PR Close #28604
  • Loading branch information
kara authored and mhevery committed Feb 8, 2019
1 parent 4b7264f commit e0d2ca2
Showing 1 changed file with 24 additions and 2 deletions.
26 changes: 24 additions & 2 deletions packages/platform-browser/test/testing_public_spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ import {CompilerConfig, ResourceLoader} from '@angular/compiler';
import {CUSTOM_ELEMENTS_SCHEMA, Compiler, Component, Directive, Inject, Injectable, Injector, Input, NgModule, Optional, Pipe, SkipSelf, ɵstringify as stringify} from '@angular/core';
import {TestBed, async, fakeAsync, getTestBed, inject, tick, withModule} from '@angular/core/testing';
import {expect} from '@angular/platform-browser/testing/src/matchers';
import {fixmeIvy, ivyEnabled, obsoleteInIvy} from '@angular/private/testing';
import {ivyEnabled, modifiedInIvy, obsoleteInIvy, onlyInIvy} from '@angular/private/testing';

// Services, and components for the tests.

Expand Down Expand Up @@ -919,7 +919,7 @@ Did you run and wait for 'resolveComponentResources()'?` :
});


fixmeIvy(`FW-721: Bindings to unknown properties are not reported as errors`)
modifiedInIvy(`Unknown property error thrown during update mode, not creation mode`)
.it('should error on unknown bound properties on custom elements by default', () => {
@Component({template: '<some-element [someUnknownProp]="true"></some-element>'})
class ComponentUsingInvalidProperty {
Expand All @@ -937,6 +937,28 @@ Did you run and wait for 'resolveComponentResources()'?` :

restoreJasmineIt();
});

onlyInIvy(`Unknown property error thrown during update mode, not creation mode`)
.it('should error on unknown bound properties on custom elements by default', () => {
@Component({template: '<some-element [someUnknownProp]="true"></some-element>'})
class ComponentUsingInvalidProperty {
}

const itPromise = patchJasmineIt();

expect(
() => it(
'should fail', withModule(
{declarations: [ComponentUsingInvalidProperty]},
() => {
const fixture =
TestBed.createComponent(ComponentUsingInvalidProperty);
fixture.detectChanges();
})))
.toThrowError(/Can't bind to 'someUnknownProp'/);

restoreJasmineIt();
});
});

describe('creating components', () => {
Expand Down

0 comments on commit e0d2ca2

Please sign in to comment.