Created
May 17, 2016 17:25
-
-
Save JeremyLikness/1b8008fcd76a2433e09893c48a73b8f9 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
it('should set the row and column', inject([], () => { | |
return builder.createAsync(CellComponentTestController) | |
.then((fixture: ComponentFixture<any>) => { | |
fixture.detectChanges(); | |
let query = fixture.debugElement.query(By.directive(CellComponent)); | |
expect(query).toBeTruthy(); | |
expect(query.componentInstance).toBeTruthy(); | |
expect(query.componentInstance.col).toBe(1); | |
expect(query.componentInstance.row).toBe(2); | |
}); | |
})); | |
@Component({ | |
selector: 'test', | |
template: ` | |
<cell [row]="row" [col]="col"></cell> | |
`, | |
directives: [CellComponent] | |
}) | |
class CellComponentTestController { | |
public col: number = 1; | |
public row: number = 2; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment