mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-01 19:17:58 +00:00
UI Conditionally Copy Tooltips (#12890)
* adds conditional tooltip copying to InfoTableRow component * adds changelog entry
This commit is contained in:
@@ -71,6 +71,29 @@ module('Integration | Component | InfoTableRow', function(hooks) {
|
||||
assert.equal(tooltip, 'Tooltip text!', 'renders tooltip text');
|
||||
});
|
||||
|
||||
test('it should copy tooltip', async function(assert) {
|
||||
assert.expect(4);
|
||||
|
||||
this.set('isCopyable', false);
|
||||
|
||||
await render(hbs`
|
||||
<InfoTableRow
|
||||
@label={{label}}
|
||||
@value={{value}}
|
||||
@tooltipText="Foo bar"
|
||||
@isTooltipCopyable={{isCopyable}}
|
||||
/>
|
||||
`);
|
||||
|
||||
await triggerEvent('[data-test-value-div="test label"] .ember-basic-dropdown-trigger', 'mouseenter');
|
||||
await settled();
|
||||
assert.dom('[data-test-tooltip-copy]').hasAttribute('disabled', '', 'Tooltip copy button is disabled');
|
||||
assert.dom('[data-test-tooltip-copy]').doesNotHaveClass('has-pointer', 'Pointer class not applied when disabled');
|
||||
this.set('isCopyable', true);
|
||||
assert.dom('[data-test-tooltip-copy]').doesNotHaveAttribute('disabled', 'Tooltip copy button is enabled');
|
||||
assert.dom('[data-test-tooltip-copy]').hasClass('has-pointer', 'Pointer class applied to copy button');
|
||||
});
|
||||
|
||||
test('it renders a string with no link if isLink is true and the item type is not an array.', async function(assert) {
|
||||
// This could be changed in the component so that it adds a link for any item type, but right now it should only add a link if item type is an array.
|
||||
await render(hbs`<InfoTableRow
|
||||
|
||||
Reference in New Issue
Block a user