Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
export default function assertTooltipRendered(assert, options = {}) {
const { selector } = options;
const tooltip = findTooltip(selector, options);
assert.ok(tooltip, 'assertTooltipRendered(): the ember-tooltip should be rendered');
}
export default function assertTooltipVisible(assert, options = {}) {
const { selector } = options;
const tooltip = findTooltip(selector, options);
const ariaHidden = tooltip.getAttribute('aria-hidden');
assert.ok(ariaHidden === 'false',
`assertTooltipVisible(): the ember-tooltip should be visible:
aria-hidden = ${ariaHidden}`);
}
export default function assertTooltipNotRendered(assert, options = {}) {
const { selector } = options;
const tooltip = findTooltip(selector, options);
assert.notOk(tooltip, 'assertTooltipNotRendered(): the ember-tooltip should not be rendered');
}
export default function assertTooltipNotVisible(assert, options = {}) {
const { selector } = options;
const tooltip = findTooltip(selector, options);
const ariaHidden = tooltip.getAttribute('aria-hidden');
assert.ok(ariaHidden === 'true',
`assertTooltipNotVisible(): the ember-tooltip shouldn't be visible:
aria-hidden = ${ariaHidden}`);
}
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.innerText.trim();
assert.equal(tooltipContent, contentString,
`Content of tooltip (${tooltipContent}) matched expected (${contentString})`);
}