chore: 🤖 rename application_credentials_sources_ids to brokered (#1255)

This commit is contained in:
Dharini Jeeva authored and GitHub committed 2022-08-15 09:48:12 -07:00
1 parent 39c0835a99
commit e3324ad64a
9 files changed
+37 -36

No files matched your search

+14 -14
View File
@@ -239,15 +239,15 @@ module('Unit | Model | target', function (hooks) {
id: '123abc',
type: 'target',
attributes: {
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
},
},
});
const target = store.peekRecord('target', '123abc');
assert.strictEqual(
target.application_credential_source_ids.length,
target.brokered_credential_source_ids.length,
2,
'Target has two entires in application_credential_source_ids'
'Target has two entires in brokered_credential_source_ids'
);
assert.strictEqual(
target.credentialSources.length,
@@ -268,17 +268,17 @@ module('Unit | Model | target', function (hooks) {
attributes: {},
},
});
// Since `credentialSources` is computed on `application_credential_source_ids`,
// 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.application_credential_source_ids =
target.application_credential_source_ids;
target.brokered_credential_source_ids =
target.brokered_credential_source_ids;
/* eslint-enable no-self-assign */
assert.strictEqual(
target.application_credential_source_ids.length,
target.brokered_credential_source_ids.length,
2,
'Target has two entires in application_credential_source_ids'
'Target has two entires in brokered_credential_source_ids'
);
assert.strictEqual(
target.credentialSources.length,
@@ -294,7 +294,7 @@ module('Unit | Model | target', function (hooks) {
(schema, request) => {
const body = JSON.parse(request.requestBody);
assert.deepEqual(body, {
application_credential_source_ids: ['123_abc', 'foobar'],
brokered_credential_source_ids: ['123_abc', 'foobar'],
version: 1,
});
return { id: '123abc' };
@@ -308,7 +308,7 @@ module('Unit | Model | target', function (hooks) {
attributes: {
name: 'Target',
description: 'Description',
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -328,7 +328,7 @@ module('Unit | Model | target', function (hooks) {
(schema, request) => {
const body = JSON.parse(request.requestBody);
assert.deepEqual(body, {
application_credential_source_ids: ['1', '2'],
brokered_credential_source_ids: ['1', '2'],
version: 1,
});
return { id: '123abc' };
@@ -342,7 +342,7 @@ module('Unit | Model | target', function (hooks) {
attributes: {
name: 'Target',
description: 'Description',
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -362,7 +362,7 @@ module('Unit | Model | target', function (hooks) {
(schema, request) => {
const body = JSON.parse(request.requestBody);
assert.deepEqual(body, {
application_credential_source_ids: ['2'],
brokered_credential_source_ids: ['2'],
version: 1,
});
return { id: '123abc' };
@@ -376,7 +376,7 @@ module('Unit | Model | target', function (hooks) {
attributes: {
name: 'Target',
description: 'Description',
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
version: 1,
scope: {
scope_id: 'o_1',
@@ -214,7 +214,7 @@ module('Unit | Serializer | application', function (hooks) {
name: 'Target 1',
scope: { id: 'o_123', scope_id: 'o_123' },
host_sources: [],
application_credential_source_ids: [],
brokered_credential_source_ids: [],
},
relationships: {},
},
@@ -15,7 +15,7 @@ module('Unit | Serializer | target', function (hooks) {
{ host_source_id: '1', host_catalog_id: '2' },
{ host_source_id: '3', host_catalog_id: '4' },
],
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
scope: {
scope_id: 'org_1',
type: 'org',
@@ -73,7 +73,7 @@ module('Unit | Serializer | target', function (hooks) {
const record = store.createRecord('target', {
name: 'User',
description: 'Description',
application_credential_source_ids: [{ value: '1' }, { value: '2' }],
brokered_credential_source_ids: [{ value: '1' }, { value: '2' }],
version: 1,
});
const snapshot = record._createSnapshot();
@@ -82,7 +82,7 @@ module('Unit | Serializer | target', function (hooks) {
};
const serializedRecord = serializer.serialize(snapshot);
assert.deepEqual(serializedRecord, {
application_credential_source_ids: ['4', '5'],
brokered_credential_source_ids: ['4', '5'],
version: 1,
});
});
@@ -131,7 +131,7 @@ module('Unit | Serializer | target', function (hooks) {
{ host_source_id: '1', host_catalog_id: '2' },
{ host_source_id: '3', host_catalog_id: '4' },
],
application_credential_source_ids: ['1'],
brokered_credential_source_ids: ['1'],
};
const normalized = serializer.normalizeSingleResponse(
store,
@@ -150,7 +150,7 @@ module('Unit | Serializer | target', function (hooks) {
{ host_source_id: '1', host_catalog_id: '2' },
{ host_source_id: '3', host_catalog_id: '4' },
],
application_credential_source_ids: [{ value: '1' }],
brokered_credential_source_ids: [{ value: '1' }],
},
relationships: {},
},
@@ -180,7 +180,7 @@ module('Unit | Serializer | target', function (hooks) {
id: '1',
type: 'target',
attributes: {
application_credential_source_ids: [],
brokered_credential_source_ids: [],
authorized_actions: [],
host_sources: [],
name: 'Target 1',
@@ -191,7 +191,7 @@ module('Unit | Serializer | target', function (hooks) {
});
});
test('it normalizes missing host_sources and application_credential_source_ids to empty array', function (assert) {
test('it normalizes missing host_sources and brokered_credential_source_ids to empty array', function (assert) {
assert.expect(1);
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('target');
@@ -216,7 +216,7 @@ module('Unit | Serializer | target', function (hooks) {
name: 'Target 1',
scope: { id: 'o_123', scope_id: 'o_123' },
host_sources: [],
application_credential_source_ids: [],
brokered_credential_source_ids: [],
},
relationships: {},
},
@@ -247,7 +247,7 @@ module('Unit | Serializer | target', function (hooks) {
authorized_actions: [],
name: 'Target 1',
host_sources: [],
application_credential_source_ids: [],
brokered_credential_source_ids: [],
worker_filter: 'worker',
},
relationships: {},