How to use the ember-tooltips/test-support/jquery.findTooltip function in ember-tooltips

To help you get started, we’ve selected a few ember-tooltips examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github sir-dunxalot / ember-tooltips / addon-test-support / jquery / get-position-differences.js View on Github external
export function getTooltipAndTargetPosition(options = {}) {
  const { selector, targetSelector } = options;
  const [ target ] = findTooltipTarget(targetSelector);
  const [ tooltip ] = findTooltip(selector, { targetSelector });

  const targetPosition = target.getBoundingClientRect();
  const tooltipPosition = tooltip.getBoundingClientRect();

  return {
    targetPosition,
    tooltipPosition,
  };
}
github sir-dunxalot / ember-tooltips / addon-test-support / jquery / assertions / assert-tooltip-visible.js View on Github external
export default function assertTooltipVisible(assert, options = {}) {
  const { selector } = options;
  const $tooltip = findTooltip(selector, options);
  const ariaHidden = $tooltip.attr('aria-hidden');

  assert.ok(ariaHidden === 'false',
    `assertTooltipVisible(): the ember-tooltip should be visible:
      aria-hidden = ${ariaHidden}`);
}
github sir-dunxalot / ember-tooltips / addon-test-support / jquery / assertions / assert-tooltip-not-visible.js View on Github external
export default function assertTooltipNotVisible(assert, options = {}) {
  const { selector } = options;
  const $tooltip = findTooltip(selector, options);
  const ariaHidden = $tooltip.attr('aria-hidden');

  assert.ok(ariaHidden === 'true',
    `assertTooltipNotVisible(): the ember-tooltip shouldn't be visible:
      aria-hidden = ${ariaHidden}`);
}
github sir-dunxalot / ember-tooltips / addon-test-support / jquery / assertions / assert-tooltip-rendered.js View on Github external
export default function assertTooltipRendered(assert, options = {}) {
  const { selector } = options;
  const $tooltip = findTooltip(selector, options);

  assert.equal($tooltip.length, 1, 'assertTooltipRendered(): the ember-tooltip should be rendered');
}
github sir-dunxalot / ember-tooltips / addon-test-support / jquery / assertions / assert-tooltip-not-rendered.js View on Github external
export default function assertTooltipNotRendered(assert, options = {}) {
  const { selector } = options;
  const $tooltip = findTooltip(selector, options);

  assert.equal($tooltip.length, 0, 'assertTooltipNotRendered(): the ember-tooltip should not be rendered');
}
github sir-dunxalot / ember-tooltips / addon-test-support / jquery / assertions / assert-tooltip-content.js View on Github external
export default function assertTooltipContent(assert, options = {}) {
  const { contentString, selector } = options;

  if (isNone(contentString)) {
    emberAssert('You must specify a contentString property in the options parameter');
  }

  const $tooltip = findTooltip(selector, options);
  const tooltipContent = $tooltip.text().trim();

  assert.equal(tooltipContent, contentString,
    `Content of tooltip (${tooltipContent}) matched expected (${contentString})`);

}