Skip to content

Instantly share code, notes, and snippets.

@IAfanasov
Created August 5, 2020 07:33
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 IAfanasov/93b89a9b479b857665889c8d1f857145 to your computer and use it in GitHub Desktop.
Save IAfanasov/93b89a9b479b857665889c8d1f857145 to your computer and use it in GitHub Desktop.
describe('placement="left"', () => {
let windowEl;
beforeEach(() => {
const fixture = createTestComponent(`<div ngbTooltip="Great tip!" placement="left"></div>`);
const directive = fixture.debugElement.query(By.directive(NgbTooltip));
triggerEvent(directive, 'mouseenter');
fixture.detectChanges();
windowEl = getWindow(fixture.nativeElement);
});
it('should have tooltip css class', () => {
expect(windowEl).toHaveCssClass('tooltip');
});
it('should have bs-tooltip-left css class', () => {
expect(windowEl).toHaveCssClass('bs-tooltip-left');
});
it('should bind the tooltip text', () => {
expect(windowEl.textContent.trim()).toBe('Great tip!');
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment