Files
twenty/packages/twenty-server/test/integration/twenty-config/utils/delete-config-variable.util.ts
T
Félix MalfaitandGitHub 8b4b9ef8da Change type import rule (#13751)
Forcing "type" to be explicit, works best will rollup on the frontend to
exclude depdendencies
2025-08-08 01:27:05 +02:00

29 lines
988 B
TypeScript

import { type PerformTwentyConfigQueryParams } from 'test/integration/twenty-config/types/perform-twenty-config-query.type';
import {
type DeleteConfigVariableFactoryInput,
deleteConfigVariableQueryFactory,
} from './delete-config-variable.query-factory.util';
import { makeAdminPanelAPIRequest } from './make-admin-panel-api-request.util';
export const deleteConfigVariable = async ({
input,
expectToFail = false,
}: PerformTwentyConfigQueryParams<DeleteConfigVariableFactoryInput>) => {
const graphqlOperation = deleteConfigVariableQueryFactory({
key: input.key,
});
const response = await makeAdminPanelAPIRequest(graphqlOperation);
if (!expectToFail) {
expect(response.body.data).toBeDefined();
expect(response.body.errors).toBeUndefined();
expect(response.body.data.deleteDatabaseConfigVariable).toBeDefined();
} else {
expect(response.body.errors).toBeDefined();
}
return { data: response.body.data, errors: response.body.errors };
};