fix: 🐛 credential library update (#3328)

* fix: 🐛 update credential library serializer

* test: 💍 adds acceptance test

* test: 💍 fix test

* fix: 🐛 fix test

* test: 💍 adds a11y ignore

* chore: 🤖 pr feedback
This commit is contained in:
Priya Patel authored and GitHub committed 2026-07-08 14:38:48 -07:00
1 parent 26e27fd24b
commit b7129e38a8
3 files changed
+109 -12

No files matched your search

@@ -138,6 +138,45 @@ module('Unit | Serializer | credential library', function (hooks) {
});
});
test('it serializes credential library updates without credential_type', function (assert) {
const store = this.owner.lookup('service:store');
const serializer = store.serializerFor('credential-library');
store.push({
data: {
id: '1',
type: 'credential-library',
attributes: {
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
name: 'Name',
description: 'Description',
path: '/vault/path',
http_method: 'GET',
version: 1,
credential_type: null,
credential_mapping_overrides: {},
},
},
});
const record = store.peekRecord('credential-library', '1');
const snapshot = record._createSnapshot();
const serializedRecord = serializer.serialize(snapshot);
assert.deepEqual(serializedRecord, {
type: TYPE_CREDENTIAL_LIBRARY_VAULT_GENERIC,
credential_store_id: null,
name: 'Name',
description: 'Description',
credential_type: null,
credential_mapping_overrides: null,
attributes: {
path: '/vault/path',
http_method: 'GET',
http_request_body: null,
},
version: 1,
});
});
test('it does not serialize http_request_body unless http_method is set to POST', function (assert) {
const store = this.owner.lookup('service:store');
const record = store.createRecord('credential-library', {