fixes application chip (icon Name) in all setting tables ## After <img width="1200" height="896" alt="image" src="https://github.com/user-attachments/assets/bd377f47-1d52-4142-b904-f2ce90c1db78" /> <img width="1200" height="917" alt="image" src="https://github.com/user-attachments/assets/f49cc742-f11e-47e3-86ed-34beffe493c7" /> <img width="1234" height="878" alt="image" src="https://github.com/user-attachments/assets/2ab459de-5f9d-4d39-9490-eec4ed9ee432" /> <img width="1239" height="845" alt="image" src="https://github.com/user-attachments/assets/3c1bf258-285a-47b9-a60d-05ba1564334d" /> <img width="1183" height="907" alt="image" src="https://github.com/user-attachments/assets/715b2470-2d88-48e3-88ac-d3daf3451717" /> <img width="1300" height="912" alt="image" src="https://github.com/user-attachments/assets/d7c829fa-bf1d-4f19-82de-a8bf29e22bfa" />
60 lines
1.6 KiB
TypeScript
60 lines
1.6 KiB
TypeScript
import { makeMetadataAPIRequest } from 'test/integration/metadata/suites/utils/make-metadata-api-request.util';
|
|
import { type CommonResponseBody } from 'test/integration/metadata/types/common-response-body.type';
|
|
import { warnIfErrorButNotExpectedToFail } from 'test/integration/metadata/utils/warn-if-error-but-not-expected-to-fail.util';
|
|
import { warnIfNoErrorButExpectedToFail } from 'test/integration/metadata/utils/warn-if-no-error-but-expected-to-fail.util';
|
|
import gql from 'graphql-tag';
|
|
|
|
import { type ApplicationDTO } from 'src/engine/core-modules/application/dtos/application.dto';
|
|
|
|
export const APPLICATION_GQL_FIELDS = `
|
|
id
|
|
name
|
|
description
|
|
logo
|
|
version
|
|
universalIdentifier
|
|
canBeUninstalled
|
|
`;
|
|
|
|
export const findManyApplications = async ({
|
|
gqlFields = APPLICATION_GQL_FIELDS,
|
|
expectToFail,
|
|
accessToken,
|
|
}: {
|
|
gqlFields?: string;
|
|
expectToFail?: boolean;
|
|
accessToken?: string;
|
|
}): CommonResponseBody<{
|
|
findManyApplications: ApplicationDTO[];
|
|
}> => {
|
|
const response = await makeMetadataAPIRequest(
|
|
{
|
|
query: gql`
|
|
query FindManyApplications {
|
|
findManyApplications {
|
|
${gqlFields}
|
|
}
|
|
}
|
|
`,
|
|
variables: {},
|
|
},
|
|
accessToken,
|
|
);
|
|
|
|
if (expectToFail === true) {
|
|
warnIfNoErrorButExpectedToFail({
|
|
response,
|
|
errorMessage: 'Application search should have failed but did not',
|
|
});
|
|
}
|
|
|
|
if (expectToFail === false) {
|
|
warnIfErrorButNotExpectedToFail({
|
|
response,
|
|
errorMessage: 'Application search has failed but should not',
|
|
});
|
|
}
|
|
|
|
return { data: response.body.data, errors: response.body.errors };
|
|
};
|