UI - kv save error (#6022)

* don't prevent model save when the model is in the error state on secrets creation

* add test
This commit is contained in:
Matthew Irish
2019-01-10 10:37:25 -06:00
committed by GitHub
parent fe5d47eda1
commit 8da2e1e9b0
2 changed files with 15 additions and 8 deletions

View File

@@ -69,6 +69,20 @@ module('Integration | Component | secret edit', function(hooks) {
assert.dom('[data-test-error]').includesText('Vault expects data to be formatted as an JSON object');
});
test('it allows saving when the model isError', async function(assert) {
this.set('mode', 'create');
this.set('model', {
isError: true,
secretData: {
int: '2',
null: 'null',
float: '1.234',
},
});
await render(hbs`<SecretEdit @mode={{mode}} @model={{model}} />`);
assert.dom('[data-test-secret-save]').isNotDisabled();
});
test('it shows an error when editing and the data is not an object', async function(assert) {
this.set('mode', 'edit');
capabilities = {