From e0d2ca261b106a7f0183da9fffbe4839d8438985 Mon Sep 17 00:00:00 2001 From: Kara Erickson Date: Thu, 7 Feb 2019 14:29:28 -0800 Subject: [PATCH] test(ivy): turn on passing test in platform-browser (#28604) 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 --- .../test/testing_public_spec.ts | 26 +++++++++++++++++-- 1 file changed, 24 insertions(+), 2 deletions(-) diff --git a/packages/platform-browser/test/testing_public_spec.ts b/packages/platform-browser/test/testing_public_spec.ts index 8df3b9ba17..ae85c71ecf 100644 --- a/packages/platform-browser/test/testing_public_spec.ts +++ b/packages/platform-browser/test/testing_public_spec.ts @@ -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. @@ -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: ''}) class ComponentUsingInvalidProperty { @@ -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: ''}) + 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', () => {