UI: KV version 2 advanced secret updates (#25235)

* Show JSON editor by default if secret data is complex, but do not disable JSON toggle

* Add text object warning to kv object editor

* a11y fix: do not disable show diff toggle

* test and language cleanup

* update language

* Update tests for expected behavior

* language!

* Add changelog
This commit is contained in:
Chelsea Shaw
2024-02-06 11:50:22 -06:00
committed by GitHub
parent a775c17cf9
commit 7c14aa6e00
18 changed files with 72 additions and 56 deletions

View File

@@ -110,4 +110,17 @@ module('Integration | Component | kv-object-editor', function (hooks) {
await click('[data-test-kv-delete-row="0"]');
assert.dom('[data-test-kv-whitespace-warning="0"]').doesNotExist();
});
test('it should display object warning for values when warnNonStringValues true', async function (assert) {
const objValue = `{
"a": "b"
}`;
await render(hbs`<KvObjectEditor @onChange={{this.spy}} @warnNonStringValues={{true}} />`);
await fillIn('[data-test-kv-value="0"]', objValue);
assert.dom('[data-test-kv-object-warning="0"]').exists();
await fillIn('[data-test-kv-value="0"]', 'test ');
assert.dom('[data-test-kv-object-warning="0"]').doesNotExist();
await fillIn('[data-test-kv-value="0"]', 7);
assert.dom('[data-test-kv-object-warning="0"]').exists();
});
});