Last active
May 22, 2022 17:11
-
-
Save gparlakov/dc7ec2b7ff84dcd7f1c58614a1a3a5fd to your computer and use it in GitHub Desktop.
This file contains hidden or 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
describe('test my chart', () => { | |
it('should draw the chart on ngAfterViewInit', () => { | |
// arrange | |
const c = setup().build(); | |
// act | |
c.ngAfterViewInit(); | |
// assert | |
expect(c.chart).toBeDefined(); | |
}); | |
it('when clicked on the second point should navigate to show the selected point if it is visible', () => { | |
// arrange | |
const { build, callOnClickWith, router } = setup().withChartGetDataVisibilityReturning(true); | |
const c = build(); | |
c.ngAfterViewInit(); | |
// act | |
callOnClickWith(1); | |
// assert | |
expect(router.navigate).toHaveBeenCalledWith([2]); | |
}); | |
it('when clicked on the second point should NOT navigate to show the selected point if it is NOT visible', () => { | |
// arrange | |
const { build, callOnClickWith, router } = | |
setup().withChartGetDataVisibilityReturning(false); | |
const c = build(); | |
c.ngAfterViewInit(); | |
// act | |
callOnClickWith(1); | |
// assert | |
expect(router.navigate).not.toHaveBeenCalledWith([2]); | |
}); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment