diff --git a/packages/core/test/linker/projection_integration_spec.ts b/packages/core/test/linker/projection_integration_spec.ts index 45831bdf36..796faf1ad2 100644 --- a/packages/core/test/linker/projection_integration_spec.ts +++ b/packages/core/test/linker/projection_integration_spec.ts @@ -82,21 +82,22 @@ import {fixmeIvy} from '@angular/private/testing'; expect(main.nativeElement).toHaveText(''); }); - fixmeIvy('unknown') && it('should support multiple content tags', () => { - TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]}); - TestBed.overrideComponent(MainComp, { - set: { - template: '' + - '
B
' + - '
C
' + - '
A
' + - '
' - } - }); - const main = TestBed.createComponent(MainComp); + fixmeIvy('FW-789: select attribute on should not be case-sensitive') && + it('should support multiple content tags', () => { + TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]}); + TestBed.overrideComponent(MainComp, { + set: { + template: '' + + '
B
' + + '
C
' + + '
A
' + + '
' + } + }); + const main = TestBed.createComponent(MainComp); - expect(main.nativeElement).toHaveText('(A, BC)'); - }); + expect(main.nativeElement).toHaveText('(A, BC)'); + }); it('should redistribute only direct children', () => { TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]}); @@ -184,34 +185,36 @@ import {fixmeIvy} from '@angular/private/testing'; expect(main.nativeElement).toHaveText('OUTER(INNER(INNERINNER(A,BC)))'); }); - fixmeIvy('unknown') && it('should redistribute when the shadow dom changes', () => { - TestBed.configureTestingModule( - {declarations: [ConditionalContentComponent, ManualViewportDirective]}); - TestBed.overrideComponent(MainComp, { - set: { - template: '' + - '
A
' + - '
B
' + - '
C
' + - '
' - } - }); - const main = TestBed.createComponent(MainComp); + fixmeIvy( + 'FW-745: Compiler isn\'t generating projectionDefs for tags inside ') && + it('should redistribute when the shadow dom changes', () => { + TestBed.configureTestingModule( + {declarations: [ConditionalContentComponent, ManualViewportDirective]}); + TestBed.overrideComponent(MainComp, { + set: { + template: '' + + '
A
' + + '
B
' + + '
C
' + + '
' + } + }); + const main = TestBed.createComponent(MainComp); - const viewportDirective = - main.debugElement.queryAllNodes(By.directive(ManualViewportDirective))[0].injector.get( - ManualViewportDirective); + const viewportDirective = + main.debugElement.queryAllNodes(By.directive(ManualViewportDirective))[0] + .injector.get(ManualViewportDirective); - expect(main.nativeElement).toHaveText('(, BC)'); + expect(main.nativeElement).toHaveText('(, BC)'); - viewportDirective.show(); - main.detectChanges(); - expect(main.nativeElement).toHaveText('(A, BC)'); + viewportDirective.show(); + main.detectChanges(); + expect(main.nativeElement).toHaveText('(A, BC)'); - viewportDirective.hide(); - main.detectChanges(); - expect(main.nativeElement).toHaveText('(, BC)'); - }); + viewportDirective.hide(); + main.detectChanges(); + expect(main.nativeElement).toHaveText('(, BC)'); + }); // GH-2095 - https://github.com/angular/angular/issues/2095 // important as we are removing the ng-content element during compilation, @@ -478,48 +481,51 @@ import {fixmeIvy} from '@angular/private/testing'; 'a2b21b22'); }); - fixmeIvy('unknown') && it('should project filled view containers into a view container', () => { - TestBed.configureTestingModule( - {declarations: [ConditionalContentComponent, ManualViewportDirective]}); - TestBed.overrideComponent(MainComp, { - set: { - template: '' + - '
A
' + - 'B' + - '
C
' + - '
D
' + - '
' - } - }); - const main = TestBed.createComponent(MainComp); + fixmeIvy( + 'FW-745: Compiler isn\'t generating projectionDefs for tags inside ') && + it('should project filled view containers into a view container', () => { + TestBed.configureTestingModule( + {declarations: [ConditionalContentComponent, ManualViewportDirective]}); + TestBed.overrideComponent(MainComp, { + set: { + template: '' + + '
A
' + + 'B' + + '
C
' + + '
D
' + + '
' + } + }); + const main = TestBed.createComponent(MainComp); - const conditionalComp = main.debugElement.query(By.directive(ConditionalContentComponent)); + const conditionalComp = + main.debugElement.query(By.directive(ConditionalContentComponent)); - const viewViewportDir = - conditionalComp.queryAllNodes(By.directive(ManualViewportDirective))[0].injector.get( - ManualViewportDirective); + const viewViewportDir = + conditionalComp.queryAllNodes(By.directive(ManualViewportDirective))[0].injector.get( + ManualViewportDirective); - expect(main.nativeElement).toHaveText('(, D)'); - expect(main.nativeElement).toHaveText('(, D)'); + expect(main.nativeElement).toHaveText('(, D)'); + expect(main.nativeElement).toHaveText('(, D)'); - viewViewportDir.show(); - main.detectChanges(); - expect(main.nativeElement).toHaveText('(AC, D)'); + viewViewportDir.show(); + main.detectChanges(); + expect(main.nativeElement).toHaveText('(AC, D)'); - const contentViewportDir = - conditionalComp.queryAllNodes(By.directive(ManualViewportDirective))[1].injector.get( - ManualViewportDirective); + const contentViewportDir = + conditionalComp.queryAllNodes(By.directive(ManualViewportDirective))[1].injector.get( + ManualViewportDirective); - contentViewportDir.show(); - main.detectChanges(); - expect(main.nativeElement).toHaveText('(ABC, D)'); + contentViewportDir.show(); + main.detectChanges(); + expect(main.nativeElement).toHaveText('(ABC, D)'); - // hide view viewport, and test that it also hides - // the content viewport's views - viewViewportDir.hide(); - main.detectChanges(); - expect(main.nativeElement).toHaveText('(, D)'); - }); + // hide view viewport, and test that it also hides + // the content viewport's views + viewViewportDir.hide(); + main.detectChanges(); + expect(main.nativeElement).toHaveText('(, D)'); + }); }); } diff --git a/packages/core/test/linker/regression_integration_spec.ts b/packages/core/test/linker/regression_integration_spec.ts index 42c1776587..cb8dc1566e 100644 --- a/packages/core/test/linker/regression_integration_spec.ts +++ b/packages/core/test/linker/regression_integration_spec.ts @@ -74,7 +74,7 @@ function declareTests(config?: {useJit: boolean}) { expect(CountingPipe.calls).toBe(1); }); - fixmeIvy('unknown') && + fixmeIvy('FW-756: Pipes and directives from imported modules are not taken into account') && it('should only update the bound property when using asyncPipe - #15205', fakeAsync(() => { @Component({template: '
'}) diff --git a/packages/core/test/linker/security_integration_spec.ts b/packages/core/test/linker/security_integration_spec.ts index 013d539812..a58da1d5bd 100644 --- a/packages/core/test/linker/security_integration_spec.ts +++ b/packages/core/test/linker/security_integration_spec.ts @@ -52,27 +52,30 @@ function declareTests(config?: {useJit: boolean}) { afterEach(() => { getDOM().log = originalLog; }); describe('events', () => { - fixmeIvy('unknown') && it('should disallow binding to attr.on*', () => { - const template = `
`; - TestBed.overrideComponent(SecuredComponent, {set: {template}}); + fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') && + it('should disallow binding to attr.on*', () => { + const template = `
`; + TestBed.overrideComponent(SecuredComponent, {set: {template}}); - expect(() => TestBed.createComponent(SecuredComponent)) - .toThrowError( - /Binding to event attribute 'onclick' is disallowed for security reasons, please use \(click\)=.../); - }); + expect(() => TestBed.createComponent(SecuredComponent)) + .toThrowError( + /Binding to event attribute 'onclick' is disallowed for security reasons, please use \(click\)=.../); + }); - fixmeIvy('unknown') && it('should disallow binding to on* with NO_ERRORS_SCHEMA', () => { - const template = `
`; - TestBed.overrideComponent(SecuredComponent, {set: {template}}).configureTestingModule({ - schemas: [NO_ERRORS_SCHEMA] - }); + fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') && + it('should disallow binding to on* with NO_ERRORS_SCHEMA', () => { + const template = `
`; + TestBed.overrideComponent(SecuredComponent, {set: {template}}).configureTestingModule({ + schemas: [NO_ERRORS_SCHEMA] + }); - expect(() => TestBed.createComponent(SecuredComponent)) - .toThrowError( - /Binding to event property 'onclick' is disallowed for security reasons, please use \(click\)=.../); - }); + expect(() => TestBed.createComponent(SecuredComponent)) + .toThrowError( + /Binding to event property 'onclick' is disallowed for security reasons, please use \(click\)=.../); + }); - fixmeIvy('unknown') && + fixmeIvy( + 'FW-786: Element properties and directive inputs are not distinguished for sanitisation purposes') && it('should disallow binding to on* unless it is consumed by a directive', () => { const template = `
`; TestBed.overrideComponent(SecuredComponent, {set: {template}}).configureTestingModule({ @@ -95,7 +98,7 @@ function declareTests(config?: {useJit: boolean}) { }); describe('safe HTML values', function() { - fixmeIvy('unknown') && it('should not escape values marked as trusted', () => { + it('should not escape values marked as trusted', () => { const template = `Link Title`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -109,7 +112,7 @@ function declareTests(config?: {useJit: boolean}) { expect(getDOM().getProperty(e, 'href')).toEqual('javascript:alert(1)'); }); - fixmeIvy('unknown') && it('should error when using the wrong trusted value', () => { + it('should error when using the wrong trusted value', () => { const template = `Link Title`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -121,7 +124,7 @@ function declareTests(config?: {useJit: boolean}) { expect(() => fixture.detectChanges()).toThrowError(/Required a safe URL, got a Script/); }); - fixmeIvy('unknown') && it('should warn when using in string interpolation', () => { + it('should warn when using in string interpolation', () => { const template = `Link Title`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -154,7 +157,7 @@ function declareTests(config?: {useJit: boolean}) { expect(value).toEqual('unsafe:javascript:alert(1)'); } - fixmeIvy('unknown') && it('should escape unsafe properties', () => { + it('should escape unsafe properties', () => { const template = `Link Title`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -162,7 +165,7 @@ function declareTests(config?: {useJit: boolean}) { checkEscapeOfHrefProperty(fixture, false); }); - fixmeIvy('unknown') && it('should escape unsafe attributes', () => { + it('should escape unsafe attributes', () => { const template = `Link Title`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -170,7 +173,7 @@ function declareTests(config?: {useJit: boolean}) { checkEscapeOfHrefProperty(fixture, true); }); - fixmeIvy('unknown') && + fixmeIvy('FW-785: Host bindings are not sanitised') && it('should escape unsafe properties if they are used in host bindings', () => { @Directive({selector: '[dirHref]'}) class HrefDirective { @@ -187,7 +190,7 @@ function declareTests(config?: {useJit: boolean}) { checkEscapeOfHrefProperty(fixture, false); }); - fixmeIvy('unknown') && + fixmeIvy('FW-785: Host bindings are not sanitised') && it('should escape unsafe attributes if they are used in host bindings', () => { @Directive({selector: '[dirHref]'}) class HrefDirective { @@ -204,7 +207,7 @@ function declareTests(config?: {useJit: boolean}) { checkEscapeOfHrefProperty(fixture, true); }); - fixmeIvy('unknown') && it('should escape unsafe style values', () => { + it('should escape unsafe style values', () => { const template = `
Text
`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent); @@ -224,15 +227,16 @@ function declareTests(config?: {useJit: boolean}) { expect(getDOM().getStyle(e, 'background')).not.toContain('javascript'); }); - fixmeIvy('unknown') && it('should escape unsafe SVG attributes', () => { - const template = `Text`; - TestBed.overrideComponent(SecuredComponent, {set: {template}}); + fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') && + it('should escape unsafe SVG attributes', () => { + const template = `Text`; + TestBed.overrideComponent(SecuredComponent, {set: {template}}); - expect(() => TestBed.createComponent(SecuredComponent)) - .toThrowError(/Can't bind to 'xlink:href'/); - }); + expect(() => TestBed.createComponent(SecuredComponent)) + .toThrowError(/Can't bind to 'xlink:href'/); + }); - fixmeIvy('unknown') && it('should escape unsafe HTML values', () => { + it('should escape unsafe HTML values', () => { const template = `
Text
`; TestBed.overrideComponent(SecuredComponent, {set: {template}}); const fixture = TestBed.createComponent(SecuredComponent);