fix(render): fix failing tests in dynamic_component_loader.ts

This commit is contained in:
Tobias Bosch 2015-06-23 17:43:36 -07:00
parent c8bdacb195
commit 6149ce28a7

View File

@ -118,8 +118,8 @@ export function main() {
.then((tc) => { .then((tc) => {
loader.loadNextToLocation(DynamicallyLoaded, tc.elementRef) loader.loadNextToLocation(DynamicallyLoaded, tc.elementRef)
.then(ref => { .then(ref => {
expect(tc.domElement).toHaveText("Location;"); expect(tc.nativeElement).toHaveText("Location;");
expect(DOM.nextSibling(tc.domElement)) expect(DOM.nextSibling(tc.nativeElement))
.toHaveText('DynamicallyLoaded;'); .toHaveText('DynamicallyLoaded;');
async.done(); async.done();
@ -142,15 +142,15 @@ export function main() {
.then(ref => { .then(ref => {
loader.loadNextToLocation(DynamicallyLoaded2, tc.elementRef) loader.loadNextToLocation(DynamicallyLoaded2, tc.elementRef)
.then(ref2 => { .then(ref2 => {
var firstSibling = DOM.nextSibling(tc.domElement); var firstSibling = DOM.nextSibling(tc.nativeElement);
var secondSibling = DOM.nextSibling(firstSibling); var secondSibling = DOM.nextSibling(firstSibling);
expect(tc.domElement).toHaveText("Location;"); expect(tc.nativeElement).toHaveText("Location;");
expect(firstSibling).toHaveText("DynamicallyLoaded;"); expect(firstSibling).toHaveText("DynamicallyLoaded;");
expect(secondSibling).toHaveText("DynamicallyLoaded2;"); expect(secondSibling).toHaveText("DynamicallyLoaded2;");
ref2.dispose(); ref2.dispose();
firstSibling = DOM.nextSibling(tc.domElement); firstSibling = DOM.nextSibling(tc.nativeElement);
secondSibling = DOM.nextSibling(firstSibling); secondSibling = DOM.nextSibling(firstSibling);
expect(secondSibling).toBeNull(); expect(secondSibling).toBeNull();
@ -177,7 +177,7 @@ export function main() {
tc.detectChanges(); tc.detectChanges();
var newlyInsertedElement = DOM.nextSibling(tc.domElement); var newlyInsertedElement = DOM.nextSibling(tc.nativeElement);
expect(newlyInsertedElement.id) expect(newlyInsertedElement.id)
.toEqual("new value") .toEqual("new value")