Skip to content

Instantly share code, notes, and snippets.

@JeremyLikness
Created May 17, 2016 17:25
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save JeremyLikness/1b8008fcd76a2433e09893c48a73b8f9 to your computer and use it in GitHub Desktop.
Save JeremyLikness/1b8008fcd76a2433e09893c48a73b8f9 to your computer and use it in GitHub Desktop.
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