Update return structure of readInputSources to match what the edit component is expecting. This also required me to make corresponding updates to the detail component so that it matched.

This commit is contained in:
mabashian 2020-07-22 13:43:41 -04:00
parent e6a1ad0127
commit 6df173ce1d
3 changed files with 13 additions and 3 deletions

View File

@ -41,7 +41,11 @@ class Credentials extends Base {
inputSources.concat(data.results)
);
}
return Promise.resolve(inputSources.concat(data.results));
return Promise.resolve({
data: {
results: inputSources.concat(data.results),
},
});
} catch (error) {
return Promise.reject(error);
}

View File

@ -60,7 +60,9 @@ function CredentialDetail({ i18n, credential }) {
{
data: { inputs: credentialTypeInputs, managed_by_tower },
},
loadedInputSources,
{
data: { results: loadedInputSources },
},
] = await Promise.all([
CredentialTypesAPI.readDetail(credential_type.id),
CredentialsAPI.readInputSources(credentialId),

View File

@ -37,7 +37,11 @@ CredentialTypesAPI.readDetail.mockResolvedValue({
data: mockCredentialType,
});
CredentialsAPI.readInputSources.mockResolvedValue([mockInputSource]);
CredentialsAPI.readInputSources.mockResolvedValue({
data: {
results: [mockInputSource],
},
});
function expectDetailToMatch(wrapper, label, value) {
const detail = wrapper.find(`Detail[label="${label}"]`);