1 | import { getPositionDifferences } from 'ember-tooltips/test-support/dom';
|
2 | import { validateSide } from 'ember-tooltips/test-support/utils';
|
3 |
|
4 | export default function assertTooltipSide(assert, options = {}) {
|
5 | const { side } = options;
|
6 |
|
7 | validateSide(side);
|
8 |
|
9 | const { expectedGreaterDistance, expectedLesserDistance } = getPositionDifferences(options);
|
10 |
|
11 | |
12 |
|
13 |
|
14 |
|
15 |
|
16 | assert.ok(expectedGreaterDistance > expectedLesserDistance,
|
17 | `Tooltip should be on the ${side} side of the target`);
|
18 | }
|