open-vault/ui/tests/unit/adapters/identity/_test-cases.js
Hamid Ghaf 27bb03bbc0
adding copyright header (#19555)
* adding copyright header

* fix fmt and a test
2023-03-15 09:00:52 -07:00

49 lines
1 KiB
JavaScript

/**
* Copyright (c) HashiCorp, Inc.
* SPDX-License-Identifier: MPL-2.0
*/
export const storeMVP = {
serializerFor() {
return {
serializeIntoHash() {},
};
},
};
export default function (modelName) {
return [
{
adapterMethod: 'findRecord',
args: [null, { modelName }, 'foo'],
url: `/v1/${modelName}/id/foo`,
method: 'GET',
},
{
adapterMethod: 'createRecord',
args: [storeMVP, { modelName }],
url: `/v1/${modelName}`,
method: 'POST',
},
{
adapterMethod: 'updateRecord',
args: [storeMVP, { modelName }, { id: 'foo', modelName }],
url: `/v1/${modelName}/id/foo`,
method: 'PUT',
},
{
adapterMethod: 'deleteRecord',
args: [storeMVP, { modelName }, { id: 'foo', modelName }],
url: `/v1/${modelName}/id/foo`,
method: 'DELETE',
},
{
adapterMethod: 'query',
args: [null, { modelName }, {}],
url: `/v1/${modelName}/id?list=true`,
method: 'GET',
},
];
}