refactor: 💡 convert brokered cred IDs array to simple attribute (#1259)
* refactor: 💡 convert brokered cred IDs array to simple attribute * fix: 🐛 missing test assertion * fix: 🐛 simplify computed * refactor: 💡 convert host sources array to simple attribute (#1260) * refactor: 💡 convert host source IDs array to simple attribute * fix: 🐛 host source tests * Refactor role fragment arrays (#1262) * refactor: 💡 convert grant strings to regular attribute * refactor: 💡 convert principals array to simple attribute * Update ui/admin/app/routes/scopes/scope/roles/role.js Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com> * fix: 🐛 remove unused import Co-authored-by: Zhihe Li <zhihe.li@hashicorp.com>
This commit is contained in:
1 parent
83c7b76f48
commit
cde6abd445
28 files changed
+147
-182
No files matched your search
@@ -1,12 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | fragment host source', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('fragment-host-source', {});
|
||||
assert.ok(model);
|
||||
});
|
||||
});
|
||||
@@ -1,12 +0,0 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Model | fragment principal', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it exists', function (assert) {
|
||||
let store = this.owner.lookup('service:store');
|
||||
let model = store.createRecord('fragment-principal', {});
|
||||
assert.ok(model);
|
||||
});
|
||||
});
|
||||
@@ -46,10 +46,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
attributes: {},
|
||||
},
|
||||
});
|
||||
// Since `hostSets` is computed on `host_sources`, not the store itself,
|
||||
// it's necessary to do this assignment to kick-off the computed update.
|
||||
// eslint-disable-next-line no-self-assign
|
||||
target.host_sources = target.host_sources;
|
||||
assert.strictEqual(
|
||||
target.host_sources.length,
|
||||
2,
|
||||
@@ -252,7 +248,7 @@ module('Unit | Model | target', function (hooks) {
|
||||
assert.strictEqual(
|
||||
target.brokeredCredentialSources.length,
|
||||
0,
|
||||
'Target has no resolved credentialSources because they are not loaded yet'
|
||||
'Target has no resolved credentialSources, because they are not yet loaded'
|
||||
);
|
||||
store.push({
|
||||
data: {
|
||||
@@ -268,12 +264,6 @@ module('Unit | Model | target', function (hooks) {
|
||||
attributes: {},
|
||||
},
|
||||
});
|
||||
// Since `credentialSources` is computed on `brokered_credential_source_ids`,
|
||||
// not the store itself, it's necessary to do this assignment to kick-off the
|
||||
// computed update.
|
||||
/* eslint-disable no-self-assign */
|
||||
target.brokered_credential_source_ids =
|
||||
target.brokered_credential_source_ids;
|
||||
/* eslint-enable no-self-assign */
|
||||
assert.strictEqual(
|
||||
target.brokered_credential_source_ids.length,
|
||||
|
||||
Reference in new issue
Block a user