From 78a33eeef9724f5c24dae8e5c40cede6d92aec04 Mon Sep 17 00:00:00 2001 From: Andrew Kushnir Date: Thu, 1 Oct 2020 18:22:32 -0700 Subject: [PATCH] test(core): remove code specific to IE 9 and IE 10 (#39090) This commit updates core tests and removes the code needed to support IE 9 and IE 10 only. The code is no longer needed since IE 9 and IE 10 support is removed in v11. PR Close #39090 --- packages/core/test/acceptance/di_spec.ts | 12 ------------ packages/core/test/acceptance/host_binding_spec.ts | 3 --- packages/core/test/acceptance/styling_spec.ts | 8 ++++---- packages/core/test/render3/providers_spec.ts | 7 ------- 4 files changed, 4 insertions(+), 26 deletions(-) diff --git a/packages/core/test/acceptance/di_spec.ts b/packages/core/test/acceptance/di_spec.ts index 27b0e15c08..4854d3f2e0 100644 --- a/packages/core/test/acceptance/di_spec.ts +++ b/packages/core/test/acceptance/di_spec.ts @@ -2304,18 +2304,6 @@ describe('di', () => { }); it('should not be able to inject ViewRef', () => { - // If the current browser does not support `__proto__` natively, this test will never - // result in an error as the `__NG_ELEMENT_ID__` from `ChangeDetectorRef` is directly - // assigned to the `ViewRef` instance, due to TypeScript, and `setPrototypeOf` polyfills - // not being able to simulate the prototype chain. This means that Angular's DI system - // considers `ViewRef` as injectable due to it having a `__NG_ELEMENT_ID__` directly - // assigned. We skip this test in such cases. This is currently the case in IE9 and - // IE10 as those don't support `__proto__`. Related TypeScript issue: - // https://github.com/microsoft/TypeScript/issues/1601#issuecomment-94892833. - if (!('__proto__' in {})) { - return; - } - @Component({template: ''}) class App { constructor(_viewRef: ViewRef) {} diff --git a/packages/core/test/acceptance/host_binding_spec.ts b/packages/core/test/acceptance/host_binding_spec.ts index 27726e66bf..30f4166c9a 100644 --- a/packages/core/test/acceptance/host_binding_spec.ts +++ b/packages/core/test/acceptance/host_binding_spec.ts @@ -1132,9 +1132,6 @@ describe('host bindings', () => { fixture.componentInstance.name = 'Ned'; fixture.detectChanges(); - // Note that we assert for each binding individually, rather than checking against - // innerHTML, because IE10 changes the attribute order and makes it inconsistent with - // all other browsers. expect(hostElement.id).toBe('red,blue'); expect(hostElement.title).toBe('blue'); expect(fixture.nativeElement.innerHTML.endsWith('Ned')).toBe(true); diff --git a/packages/core/test/acceptance/styling_spec.ts b/packages/core/test/acceptance/styling_spec.ts index 42e4934f9b..df12c82c9b 100644 --- a/packages/core/test/acceptance/styling_spec.ts +++ b/packages/core/test/acceptance/styling_spec.ts @@ -3460,8 +3460,8 @@ describe('styling', () => { if (!ivyEnabled && !supportsWritingStringsToStyleProperty()) { // VE does not treat `[style]` as anything special, instead it simply writes to the // `style` property on the element like so `element.style=value`. This seems to work fine - // every where except ie10, where it throws an error and as a consequence this test fails in - // VE on ie10. + // every where except IE11, where it throws an error and as a consequence this test fails in + // VE on IE11. return; } @Component({template: `
`}) @@ -3479,7 +3479,7 @@ describe('styling', () => { /** * Tests to see if the current browser supports non standard way of writing into styles. * - * This is not the correct way to write to style and is not supported in ie10. + * This is not the correct way to write to style and is not supported in IE11. * ``` * div.style = 'color: white'; * ``` @@ -3490,7 +3490,7 @@ describe('styling', () => { * ``` * * Even though writing to `div.style` is not officially supported, it works in all - * browsers except ie10. + * browsers except IE11. * * This function detects this condition and allows us to skip the test. */ diff --git a/packages/core/test/render3/providers_spec.ts b/packages/core/test/render3/providers_spec.ts index e41a689833..b75bf504ab 100644 --- a/packages/core/test/render3/providers_spec.ts +++ b/packages/core/test/render3/providers_spec.ts @@ -1290,13 +1290,6 @@ describe('providers', () => { function addFoo() { return (constructor: Type): any => { const decoratedClass = class Extender extends constructor { foo = 'bar'; }; - - // On IE10 child classes don't inherit static properties by default. If we detect - // such a case, try to account for it so the tests are consistent between browsers. - if (Object.getPrototypeOf(decoratedClass) !== constructor) { - decoratedClass.prototype = constructor.prototype; - } - return decoratedClass; }; }