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
@@ -0,0 +1,28 @@
|
||||
import { module, test } from 'qunit';
|
||||
import { setupTest } from 'ember-qunit';
|
||||
|
||||
module('Unit | Transform | string array', function (hooks) {
|
||||
setupTest(hooks);
|
||||
|
||||
test('it deserializes an array of strings to an array of `{value}`', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const deserialized = transform.deserialize(['a', 'bee', 'Hello World']);
|
||||
assert.deepEqual(deserialized, [
|
||||
{ value: 'a' },
|
||||
{ value: 'bee' },
|
||||
{ value: 'Hello World' },
|
||||
]);
|
||||
});
|
||||
|
||||
test('it serializes an array of `{value}` to an array of strings', function (assert) {
|
||||
assert.expect(1);
|
||||
const transform = this.owner.lookup('transform:string-array');
|
||||
const serialized = transform.serialize([
|
||||
{ value: 'a' },
|
||||
{ value: 'bee' },
|
||||
{ value: 'Hello World' },
|
||||
]);
|
||||
assert.deepEqual(serialized, ['a', 'bee', 'Hello World']);
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user