Skip to content

Commit

Permalink
fix(popover): hide when host was removed (#430)
Browse files Browse the repository at this point in the history
  • Loading branch information
tibing-old-email authored and nnixaa committed May 19, 2018
1 parent ca81f90 commit a07496d
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 0 deletions.
9 changes: 9 additions & 0 deletions e2e/popover.e2e-spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -164,4 +164,13 @@ describe('nb-popover', () => {
const text = element(popover).element(by.css('nb-dynamic-to-add > div > strong')).getText();
expect(text).toEqual('hello from dynamically inserted component: Example context');
});

it('have to hide popover when host removed', done => {
element(contentTemplate).click();
expect(element(popover).isPresent()).toBeTruthy();
browser.get('#/').then(() => {
expect(element(popover).isPresent()).toBeFalsy();
done();
})
});
});
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,7 @@ export class NbPopoverDirective implements OnInit, OnDestroy {

ngOnDestroy() {
this.alive = false;
this.hide();
}

/**
Expand Down

0 comments on commit a07496d

Please sign in to comment.