refactor(ivy): remove usage of Proxy for IE10/11 compatibility (#34328)

PR Close #34328
This commit is contained in:
Pawel Kozlowski
2019-12-10 15:55:53 +01:00
committed by Kara Erickson
parent d661f1e993
commit 4779d24e75
4 changed files with 14 additions and 47 deletions

View File

@ -2238,9 +2238,9 @@ describe('styling', () => {
constructor(public elementRef: ElementRef, public renderer: Renderer2) { dirInstance = this; }
setStyles() {
this.renderer.setStyle(
this.elementRef.nativeElement, 'transform', 'translate3d(0px, 0px, 0px)');
this.renderer.addClass(this.elementRef.nativeElement, 'my-class');
const nativeEl = this.elementRef.nativeElement;
this.renderer.setStyle(nativeEl, 'transform', 'translate3d(0px, 0px, 0px)');
this.renderer.addClass(nativeEl, 'my-class');
}
}
@ -2258,16 +2258,6 @@ describe('styling', () => {
const div = fixture.debugElement.children[0];
expect(div.styles.transform).toMatch(/translate3d\(0px\s*,\s*0px\s*,\s*0px\)/);
expect(div.classes['my-class']).toBe(true);
div.classes['other-class'] = true;
div.styles['width'] = '200px';
expect(div.styles.width).toEqual('200px');
expect(div.classes['other-class']).toBe(true);
if (ivyEnabled) {
expect(div.nativeElement.classList.contains('other-class')).toBeTruthy();
expect(div.nativeElement.style['width']).toEqual('200px');
}
});
it('should not set classes when falsy value is passed while a sanitizer is present', () => {

View File

@ -354,7 +354,7 @@ class TestCmptWithPropInterpolation {
const bankElem = fixture.debugElement.children[0];
expect(bankElem.classes['closed']).toBe(true);
expect(bankElem.classes['open']).toBe(false);
expect(bankElem.classes['open']).toBeFalsy();
});
it('should get element classes from host bindings', () => {
@ -365,7 +365,7 @@ class TestCmptWithPropInterpolation {
expect(debugElement.classes['present-class'])
.toBe(true, 'Expected bound host CSS class "present-class" to be present');
expect(debugElement.classes['absent-class'])
.toBe(false, 'Expected bound host CSS class "absent-class" to be absent');
.toBeFalsy('Expected bound host CSS class "absent-class" to be absent');
});
it('should list element styles', () => {