refactor(core): move server-only DomAdapter methods into ServerRenderer (#32408)

PR Close #32408
This commit is contained in:
Kara Erickson
2019-08-29 21:24:33 -07:00
committed by Miško Hevery
parent 1ed3531049
commit 970b58b13f
16 changed files with 61 additions and 123 deletions

View File

@ -124,7 +124,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
fixture.detectChanges();
let els = fixture.debugElement.queryAll(By.css('span'));
expect(els.length).toEqual(1);
getDOM().addClass(els[0].nativeElement, 'marker');
els[0].nativeElement.classList.add('marker');
expect(fixture.nativeElement).toHaveText('hello');
getComponent().numberCondition = 2;

View File

@ -37,7 +37,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
// We must use getDOM().querySelector instead of fixture.query here
// since the elements inside are not compiled.
const span = getDOM().querySelector(fixture.nativeElement, '#child');
const span = fixture.nativeElement.querySelector('#child');
expect(hasClass(span, 'compiled')).toBeFalsy();
}));
@ -45,7 +45,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
const template = '<div><span id=child ngNonBindable test-dec>{{text}}</span></div>';
const fixture = createTestComponent(template);
fixture.detectChanges();
const span = getDOM().querySelector(fixture.nativeElement, '#child');
const span = fixture.nativeElement.querySelector('#child');
expect(hasClass(span, 'compiled')).toBeTruthy();
}));
});
@ -53,7 +53,7 @@ import {expect} from '@angular/platform-browser/testing/src/matchers';
@Directive({selector: '[test-dec]'})
class TestDirective {
constructor(el: ElementRef) { getDOM().addClass(el.nativeElement, 'compiled'); }
constructor(el: ElementRef) { el.nativeElement.classList.add('compiled'); }
}
@Component({selector: 'test-cmp', template: ''})