Skip to content

Commit

Permalink
Testing tooltip side closest to the target is in the right position
Browse files Browse the repository at this point in the history
  • Loading branch information
Duncan Graham Walker committed Dec 22, 2016
1 parent 83dcb70 commit ac970b8
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 5 deletions.
8 changes: 4 additions & 4 deletions test-support/helpers/ember-tooltips.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,16 +126,16 @@ export function assertTooltipSide(assert, options = {}) {
const tooltipPosition = $tooltip[0].getBoundingClientRect();

if (expectedSide === 'top') {
assert.ok(targetPosition.top > tooltipPosition.top,
assert.ok(targetPosition.top > tooltipPosition.bottom,
'Tooltip should be above the target');
} else if (expectedSide === 'right') {
assert.ok(targetPosition.left < tooltipPosition.left,
assert.ok(targetPosition.right < tooltipPosition.left,
'Tooltip should be right of the target');
} else if (expectedSide === 'bottom') {
assert.ok(targetPosition.top < tooltipPosition.top,
assert.ok(targetPosition.bottom < tooltipPosition.top,
'Tooltip should be below the target');
} else if (expectedSide === 'left') {
assert.ok(targetPosition.left > tooltipPosition.left,
assert.ok(targetPosition.left > tooltipPosition.right,
'Tooltip should be left of the target');
}
}
2 changes: 1 addition & 1 deletion tests/integration/components/side-test.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,6 @@ test('tooltip-on-element shows with showOn left', function(assert) {
// {{/tooltip-on-element}}
// `);

// assertPosition(assert, this, 'right');
// assertTooltipSide(assert, { side: 'right' });

// });

0 comments on commit ac970b8

Please sign in to comment.