mirror of
https://github.com/optim-enterprises-bv/vault.git
synced 2025-11-02 03:27:54 +00:00
KV automatic delete state issue in UI (#13166)
* converts secret-v2-version model to native class -- fixes issues with cached values for deleted prop * adds changelog entry * adds disabled state to ToolbarLink component and disables create new version action when users cannot read metadata * updates secret-edit acceptance test
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupRenderingTest } from 'ember-qunit';
|
||||
import { render } from '@ember/test-helpers';
|
||||
import { render, triggerEvent } from '@ember/test-helpers';
|
||||
import { isPresent } from 'ember-cli-page-object';
|
||||
import hbs from 'htmlbars-inline-precompile';
|
||||
|
||||
@@ -14,4 +14,41 @@ module('Integration | Component | toolbar-link', function(hooks) {
|
||||
assert.ok(isPresent('.toolbar-link'));
|
||||
assert.ok(isPresent('.icon'));
|
||||
});
|
||||
|
||||
test('it should render icons', async function(assert) {
|
||||
assert.expect(2);
|
||||
|
||||
await render(hbs`
|
||||
<ToolbarLink
|
||||
@params={{array '/secrets'}}
|
||||
@type={{this.type}}
|
||||
>
|
||||
Test Link
|
||||
</ToolbarLink>
|
||||
`);
|
||||
|
||||
assert.dom('[data-test-icon="chevron-right"]').exists('Default chevron right icon renders');
|
||||
this.set('type', 'add');
|
||||
assert.dom('[data-test-icon="plus-plain"]').exists('Icon can be overriden to show plus sign');
|
||||
});
|
||||
|
||||
test('it should disable and show tooltip if provided', async function(assert) {
|
||||
assert.expect(3);
|
||||
|
||||
await render(hbs`
|
||||
<ToolbarLink
|
||||
@params={{array '/secrets'}}
|
||||
@disabled={{true}}
|
||||
@disabledTooltip={{this.tooltip}}
|
||||
>
|
||||
Test Link
|
||||
</ToolbarLink>
|
||||
`);
|
||||
|
||||
assert.dom('a').hasClass('disabled', 'Link can be disabled');
|
||||
assert.dom('[data-test-popup-menu-trigger]').doesNotExist('Tooltip is hidden when not provided');
|
||||
this.set('tooltip', 'Test tooltip');
|
||||
await triggerEvent('.ember-basic-dropdown-trigger', 'mouseenter');
|
||||
assert.dom('[data-test-disabled-tooltip]').hasText(this.tooltip, 'Tooltip renders');
|
||||
});
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user