test(ivy): update root causes for @angular/core TestBed failures (#27459)

PR Close #27459
This commit is contained in:
Pawel Kozlowski 2018-12-04 16:30:13 +01:00 committed by Igor Minar
parent 8973f12ee4
commit b25f06ee7c
3 changed files with 116 additions and 106 deletions

View File

@ -82,7 +82,8 @@ import {fixmeIvy} from '@angular/private/testing';
expect(main.nativeElement).toHaveText('');
});
fixmeIvy('unknown') && it('should support multiple content tags', () => {
fixmeIvy('FW-789: select attribute on <ng-content> should not be case-sensitive') &&
it('should support multiple content tags', () => {
TestBed.configureTestingModule({declarations: [MultipleContentTagsComponent]});
TestBed.overrideComponent(MainComp, {
set: {
@ -184,7 +185,9 @@ 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', () => {
fixmeIvy(
'FW-745: Compiler isn\'t generating projectionDefs for <ng-content> tags inside <ng-templates>') &&
it('should redistribute when the shadow dom changes', () => {
TestBed.configureTestingModule(
{declarations: [ConditionalContentComponent, ManualViewportDirective]});
TestBed.overrideComponent(MainComp, {
@ -199,8 +202,8 @@ import {fixmeIvy} from '@angular/private/testing';
const main = TestBed.createComponent(MainComp);
const viewportDirective =
main.debugElement.queryAllNodes(By.directive(ManualViewportDirective))[0].injector.get(
ManualViewportDirective);
main.debugElement.queryAllNodes(By.directive(ManualViewportDirective))[0]
.injector.get(ManualViewportDirective);
expect(main.nativeElement).toHaveText('(, BC)');
@ -478,7 +481,9 @@ import {fixmeIvy} from '@angular/private/testing';
'<cmp-a2>a2<cmp-b21>b21</cmp-b21><cmp-b22>b22</cmp-b22></cmp-a2>');
});
fixmeIvy('unknown') && it('should project filled view containers into a view container', () => {
fixmeIvy(
'FW-745: Compiler isn\'t generating projectionDefs for <ng-content> tags inside <ng-templates>') &&
it('should project filled view containers into a view container', () => {
TestBed.configureTestingModule(
{declarations: [ConditionalContentComponent, ManualViewportDirective]});
TestBed.overrideComponent(MainComp, {
@ -493,7 +498,8 @@ import {fixmeIvy} from '@angular/private/testing';
});
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(

View File

@ -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: '<div myDir [a]="p | async" [b]="2"></div>'})

View File

@ -52,7 +52,8 @@ function declareTests(config?: {useJit: boolean}) {
afterEach(() => { getDOM().log = originalLog; });
describe('events', () => {
fixmeIvy('unknown') && it('should disallow binding to attr.on*', () => {
fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') &&
it('should disallow binding to attr.on*', () => {
const template = `<div [attr.onclick]="ctxProp"></div>`;
TestBed.overrideComponent(SecuredComponent, {set: {template}});
@ -61,7 +62,8 @@ function declareTests(config?: {useJit: boolean}) {
/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', () => {
fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') &&
it('should disallow binding to on* with NO_ERRORS_SCHEMA', () => {
const template = `<div [onclick]="ctxProp"></div>`;
TestBed.overrideComponent(SecuredComponent, {set: {template}}).configureTestingModule({
schemas: [NO_ERRORS_SCHEMA]
@ -72,7 +74,8 @@ function declareTests(config?: {useJit: boolean}) {
/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 = `<div [onPrefixedProp]="ctxProp" [onclick]="ctxProp"></div>`;
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 = `<a [href]="ctxProp">Link Title</a>`;
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 = `<a [href]="ctxProp">Link Title</a>`;
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 = `<a href="/foo/{{ctxProp}}">Link Title</a>`;
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 = `<a [href]="ctxProp">Link Title</a>`;
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 = `<a [attr.href]="ctxProp">Link Title</a>`;
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 = `<div [style.background]="ctxProp">Text</div>`;
TestBed.overrideComponent(SecuredComponent, {set: {template}});
const fixture = TestBed.createComponent(SecuredComponent);
@ -224,7 +227,8 @@ function declareTests(config?: {useJit: boolean}) {
expect(getDOM().getStyle(e, 'background')).not.toContain('javascript');
});
fixmeIvy('unknown') && it('should escape unsafe SVG attributes', () => {
fixmeIvy('FW-787: Exception in template parsing leaves TestBed in corrupted state') &&
it('should escape unsafe SVG attributes', () => {
const template = `<svg:circle [xlink:href]="ctxProp">Text</svg:circle>`;
TestBed.overrideComponent(SecuredComponent, {set: {template}});
@ -232,7 +236,7 @@ function declareTests(config?: {useJit: boolean}) {
.toThrowError(/Can't bind to 'xlink:href'/);
});
fixmeIvy('unknown') && it('should escape unsafe HTML values', () => {
it('should escape unsafe HTML values', () => {
const template = `<div [innerHTML]="ctxProp">Text</div>`;
TestBed.overrideComponent(SecuredComponent, {set: {template}});
const fixture = TestBed.createComponent(SecuredComponent);