# Introduction Migrating and improving performances of field enum integrations tests success and failing tests cases to be using the new v2 api ## Discovered issue When deleting an object in v1 it will leave related enums until the object is re-created Something not done anymore within the create in v2 but in the delete operation We should implem an upgrade command to remove such relicas ## Bugs - Update/create default value multi select runner wrong sql query -> FIX - Update default value multi select regression, we should allow option without an id to be inserted -> FIX - default value compare dynamic json stringify convertion or not in compare tools for object and fields
42 lines
1.4 KiB
TypeScript
42 lines
1.4 KiB
TypeScript
import { makeGraphqlAPIRequest } from 'test/integration/graphql/utils/make-graphql-api-request.util';
|
|
import { updateFeatureFlagFactory } from 'test/integration/graphql/utils/update-feature-flag-factory.util';
|
|
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 { type FeatureFlagKey } from 'src/engine/core-modules/feature-flag/enums/feature-flag-key.enum';
|
|
import { SEED_APPLE_WORKSPACE_ID } from 'src/engine/workspace-manager/dev-seeder/core/utils/seed-workspaces.util';
|
|
|
|
export const updateFeatureFlag = async ({
|
|
featureFlag,
|
|
value,
|
|
workspaceId = SEED_APPLE_WORKSPACE_ID,
|
|
expectToFail,
|
|
}: {
|
|
featureFlag: FeatureFlagKey;
|
|
value: boolean;
|
|
workspaceId?: string;
|
|
expectToFail: boolean;
|
|
}) => {
|
|
const enablePermissionsQuery = updateFeatureFlagFactory(
|
|
workspaceId,
|
|
featureFlag,
|
|
value,
|
|
);
|
|
|
|
const response = await makeGraphqlAPIRequest(enablePermissionsQuery);
|
|
|
|
if (expectToFail === false) {
|
|
warnIfErrorButNotExpectedToFail({
|
|
errorMessage: 'Update feature flag should not have failed',
|
|
response,
|
|
});
|
|
}
|
|
|
|
if (expectToFail === true) {
|
|
warnIfNoErrorButExpectedToFail({
|
|
errorMessage: 'Update feature flag should have failed',
|
|
response,
|
|
});
|
|
}
|
|
};
|