snapshot of https://github.com/twentyhq/twenty.git (main, 2026-09-17; blobs > 131072B omitted)
Some checks failed
App Prod-Parity E2E Dispatch / dispatch (push) Failing after 10s
CD Storybook UI / build (push) Failing after 3m25s
CD Storybook UI / dispatch (push) Has been skipped
CD deploy main / website-changed-files (push) Successful in 18m8s
CI Agent Skills / changed-files-check (push) Successful in 18m9s
CI Create App E2E minimal / changed-files-check (push) Successful in 24s
CI Create App / changed-files-check (push) Successful in 26s
CI Docs / changed-files-check (push) Successful in 26s
CI Emails / changed-files-check (push) Successful in 28s
CI Example App Hello World / changed-files-check (push) Successful in 23s
CI Front / changed-files-check (push) Has been skipped
CI Example App Postcard / changed-files-check (push) Successful in 27s
CI UI / changed-files-check (push) Has been skipped
CI Utils Test / changed-files-check (push) Successful in 45s
CI Twenty Apps / discover (push) Successful in 1m3s
CD deploy main / deploy-main (push) Failing after 3s
CI Agent Skills / agent-skills-validate (push) Has been skipped
CI Create App / create-app-test (lint) (push) Has been skipped
CI Emails / emails-test (push) Has been skipped
CI Front / front-task (lingui:compile) (push) Has been skipped
CI Front / front-task (lint) (push) Has been skipped
CI Example App Postcard / example-app-postcard (push) Has been skipped
CI UI / ui-task (lint) (push) Has been skipped
CI UI / ui-task (pack-size) (push) Has been skipped
CI UI / ui-task (size) (push) Has been skipped
CI UI / ui-task (test) (push) Has been skipped
CI UI / ui-task (typecheck) (push) Has been skipped
CI Utils Test / utils-test (push) Has been skipped
CI Twenty Apps / ${{ matrix.app.name }} (push) Has been skipped
CI Emails / ci-emails-status-check (push) Successful in 2s
CI Example App Hello World / ci-example-app-hello-world-status-check (push) Successful in 2s
CI Example App Postcard / ci-example-app-postcard-status-check (push) Successful in 3s
CI UI / ui-sb-test (push) Has been skipped
CI Utils Test / ci-utils-test-status-check (push) Successful in 2s
CI Twenty Apps / ci-twenty-apps-status-check (push) Successful in 2s
CI UI / ci-ui-status-check (push) Successful in 2s
CI Desktop / desktop (push) Failing after 1m8s
Push docs to Crowdin / Push documentation to Crowdin (push) Failing after 55s
Push translations to Crowdin / Extract and upload translations (push) Failing after 5s
Push website translations to Crowdin / Extract and upload website translations (push) Failing after 5s
CI Create App / create-app-test (test) (push) Has been skipped
CI Create App / create-app-test (typecheck) (push) Has been skipped
CI Docs / docs-lint (push) Has been skipped
CI Example App Hello World / example-app-hello-world (push) Has been skipped
CI Front / front-task (lingui:extract) (push) Has been skipped
CI Front / front-task (test) (push) Has been skipped
CI Front / front-task (typecheck) (push) Has been skipped
CI UI / ui-sb-build (push) Failing after 1m32s
CI Twenty Apps / ${{ matrix.app.name }} (${{ matrix.server-source }}) (push) Has been skipped
CI Agent Skills / agent-skills-publish (push) Has been skipped
CI Create App / ci-create-app-status-check (push) Successful in 2s
CI Agent Skills / agent-skills-remote-source (push) Has been skipped
CI Create App E2E minimal / create-app-e2e-minimal (push) Has been cancelled
CI E2E Main / e2e-test (push) Has been cancelled
CI Front / front-sb-build (push) Has been cancelled
CI Front / front-build (push) Has been cancelled
CI Create App E2E minimal / ci-create-app-e2e-minimal-status-check (push) Has been cancelled
CI E2E Main / ci-e2e-main-status-check (push) Has been cancelled
CI E2E Main / notify-main-ci-failure (push) Has been cancelled
CI E2E Main / qa-scout-comment (push) Has been cancelled
CI Front / front-sb-test (push) Has been cancelled
CI Front / front-sb-screenshots (push) Has been cancelled
CI Front / ci-front-status-check (push) Has been cancelled
DPA Sub-Processor Sync / sync-subprocessors (push) Failing after 3s
AI Catalog Sync / sync-catalog (push) Failing after 2s

This commit is contained in:
upstream-mirror
2026-09-17 23:28:13 +05:00
commit e7da97194a
32688 changed files with 4208681 additions and 0 deletions

View File

@@ -0,0 +1,235 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`CommandMenuItem creation should fail when creating with empty label 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "Label is required",
"userFriendlyMessage": "Label is required",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "create",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Label is required",
},
"message": "Multiple validation errors occurred while creating command menu item",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating with missing label 1`] = `
{
"extensions": {
"code": "BAD_USER_INPUT",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
},
"message": "Field "label" of required type "String!" was not provided.",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating with missing engineComponentKey 1`] = `
{
"extensions": {
"code": "BAD_USER_INPUT",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
},
"message": "Field "engineComponentKey" of required type "EngineComponentKey!" was not provided.",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating with empty workflowVersionId 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "",
},
"message": "Invalid UUID: ''",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem creation should fail when creating with invalid workflowVersionId (not a UUID) 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "not-a-valid-uuid",
},
"message": "Invalid UUID: 'not-a-valid-uuid'",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem creation should fail when creating TRIGGER_WORKFLOW_VERSION without workflowVersionId 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "workflowVersionId is required when engineComponentKey is TRIGGER_WORKFLOW_VERSION",
"userFriendlyMessage": "Workflow version is required for workflow trigger items",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "create",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Workflow version is required for workflow trigger items",
},
"message": "Multiple validation errors occurred while creating command menu item",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating TRIGGER_WORKFLOW_VERSION with frontComponentId 1`] = `
{
"extensions": {
"code": "NOT_FOUND",
"subCode": "RELATION_UNIVERSAL_IDENTIFIER_NOT_FOUND",
"userFriendlyMessage": "An error occurred.",
},
"message": "Could not find frontComponent for given frontComponentId",
"name": "NotFoundError",
}
`;
exports[`CommandMenuItem creation should fail when creating FRONT_COMPONENT_RENDERER without frontComponentId 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "frontComponentId is required when engineComponentKey is FRONT_COMPONENT_RENDERER",
"userFriendlyMessage": "Front component is required for front component renderer items",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "create",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Front component is required for front component renderer items",
},
"message": "Multiple validation errors occurred while creating command menu item",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating FRONT_COMPONENT_RENDERER with workflowVersionId 1`] = `
{
"extensions": {
"code": "NOT_FOUND",
"subCode": "RELATION_UNIVERSAL_IDENTIFIER_NOT_FOUND",
"userFriendlyMessage": "An error occurred.",
},
"message": "Could not find frontComponent for given frontComponentId",
"name": "NotFoundError",
}
`;
exports[`CommandMenuItem creation should fail when creating standard key with workflowVersionId 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "workflowVersionId must not be set for engine component key GO_TO_PEOPLE",
"userFriendlyMessage": "Workflow version must not be set for this item type",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "create",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Workflow version must not be set for this item type",
},
"message": "Multiple validation errors occurred while creating command menu item",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem creation should fail when creating standard key with frontComponentId 1`] = `
{
"extensions": {
"code": "NOT_FOUND",
"subCode": "RELATION_UNIVERSAL_IDENTIFIER_NOT_FOUND",
"userFriendlyMessage": "An error occurred.",
},
"message": "Could not find frontComponent for given frontComponentId",
"name": "NotFoundError",
}
`;

View File

@@ -0,0 +1,57 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`CommandMenuItem deletion should fail when deleting a non-existent command menu item 1`] = `
{
"extensions": {
"code": "NOT_FOUND",
"subCode": "COMMAND_MENU_ITEM_NOT_FOUND",
"userFriendlyMessage": "Command menu item not found.",
},
"message": "Command menu item not found",
"name": "NotFoundError",
}
`;
exports[`CommandMenuItem deletion should fail when deleting with empty id 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "",
},
"message": "Invalid UUID: ''",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem deletion should fail when deleting with invalid id (not a UUID) 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "not-a-valid-uuid",
},
"message": "Invalid UUID: 'not-a-valid-uuid'",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem deletion should fail when deleting with missing id 1`] = `
{
"extensions": {
"code": "BAD_USER_INPUT",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
},
"message": "Variable "$id" of required type "UUID!" was not provided.",
"name": "GraphQLError",
}
`;

View File

@@ -0,0 +1,127 @@
// Jest Snapshot v1, https://jestjs.io/docs/snapshot-testing
exports[`CommandMenuItem update should fail when updating a non-existent command menu item 1`] = `
{
"extensions": {
"code": "NOT_FOUND",
"subCode": "COMMAND_MENU_ITEM_NOT_FOUND",
"userFriendlyMessage": "Command menu item not found.",
},
"message": "Command menu item not found",
"name": "NotFoundError",
}
`;
exports[`CommandMenuItem update should fail when updating with empty id 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "",
},
"message": "Invalid UUID: ''",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem update should fail when updating with empty label 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "Label is required",
"userFriendlyMessage": "Label is required",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "update",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Label is required",
},
"message": "Multiple validation errors occurred while updating command menu item",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem update should fail when updating with invalid id (not a UUID) 1`] = `
{
"extensions": {
"code": "GRAPHQL_VALIDATION_FAILED",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
"value": "not-a-valid-uuid",
},
"message": "Invalid UUID: 'not-a-valid-uuid'",
"name": "ValidationError",
}
`;
exports[`CommandMenuItem update should fail when updating with missing id 1`] = `
{
"extensions": {
"code": "BAD_USER_INPUT",
"http": {
"status": 400,
},
"userFriendlyMessage": "An error occurred.",
},
"message": "Field "id" of required type "UUID!" was not provided.",
"name": "GraphQLError",
}
`;
exports[`CommandMenuItem update should fail when changing engineComponentKey to a standard key on an item with workflowVersionId 1`] = `
{
"extensions": {
"code": "METADATA_VALIDATION_FAILED",
"errors": {
"commandMenuItem": [
{
"errors": [
{
"code": "INVALID_COMMAND_MENU_ITEM_INPUT",
"message": "workflowVersionId must not be set for engine component key GO_TO_PEOPLE",
"userFriendlyMessage": "Workflow version must not be set for this item type",
},
],
"flatEntityMinimalInformation": {
"universalIdentifier": Any<String>,
},
"metadataName": "commandMenuItem",
"status": "fail",
"type": "update",
},
],
},
"message": "Validation failed for 1 commandMenuItem",
"summary": {
"commandMenuItem": 1,
"totalErrors": 1,
},
"userFriendlyMessage": "Workflow version must not be set for this item type",
},
"message": "Multiple validation errors occurred while updating command menu item",
"name": "GraphQLError",
}
`;

View File

@@ -0,0 +1,141 @@
import { faker } from '@faker-js/faker';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { createCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item.util';
import {
eachTestingContextFilter,
type EachTestingContext,
} from 'twenty-shared/testing';
import { type CreateCommandMenuItemInput } from 'src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input';
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
type TestContext = {
input: CreateCommandMenuItemInput;
};
const failingCommandMenuItemCreationTestCases: EachTestingContext<TestContext>[] =
[
{
title: 'when creating with empty label',
context: {
input: {
workflowVersionId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: '',
},
},
},
{
title: 'when creating with missing label',
context: {
input: {
workflowVersionId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
} as CreateCommandMenuItemInput,
},
},
{
title: 'when creating with missing engineComponentKey',
context: {
input: {
label: 'Test Label',
} as CreateCommandMenuItemInput,
},
},
{
title: 'when creating with empty workflowVersionId',
context: {
input: {
workflowVersionId: '',
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Label',
},
},
},
{
title: 'when creating with invalid workflowVersionId (not a UUID)',
context: {
input: {
workflowVersionId: 'not-a-valid-uuid',
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Label',
},
},
},
{
title: 'when creating TRIGGER_WORKFLOW_VERSION without workflowVersionId',
context: {
input: {
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Label',
},
},
},
{
title: 'when creating TRIGGER_WORKFLOW_VERSION with frontComponentId',
context: {
input: {
workflowVersionId: faker.string.uuid(),
frontComponentId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Label',
},
},
},
{
title: 'when creating FRONT_COMPONENT_RENDERER without frontComponentId',
context: {
input: {
engineComponentKey: EngineComponentKey.FRONT_COMPONENT_RENDERER,
label: 'Test Label',
},
},
},
{
title: 'when creating FRONT_COMPONENT_RENDERER with workflowVersionId',
context: {
input: {
frontComponentId: faker.string.uuid(),
workflowVersionId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.FRONT_COMPONENT_RENDERER,
label: 'Test Label',
},
},
},
{
title: 'when creating standard key with workflowVersionId',
context: {
input: {
workflowVersionId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.GO_TO_PEOPLE,
label: 'Test Label',
},
},
},
{
title: 'when creating standard key with frontComponentId',
context: {
input: {
frontComponentId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.GO_TO_PEOPLE,
label: 'Test Label',
},
},
},
];
describe('CommandMenuItem creation should fail', () => {
it.each(eachTestingContextFilter(failingCommandMenuItemCreationTestCases))(
'$title',
async ({ context }) => {
const { errors } = await createCommandMenuItem({
expectToFail: true,
input: context.input,
});
expectOneNotInternalServerErrorSnapshot({
errors,
});
},
);
});

View File

@@ -0,0 +1,62 @@
import { faker } from '@faker-js/faker';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { type DeleteCommandMenuItemFactoryInput } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item-query-factory.util';
import { deleteCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item.util';
import {
eachTestingContextFilter,
type EachTestingContext,
} from 'twenty-shared/testing';
type TestContext = {
input: DeleteCommandMenuItemFactoryInput;
};
const failingCommandMenuItemDeletionTestCases: EachTestingContext<TestContext>[] =
[
{
title: 'when deleting a non-existent command menu item',
context: {
input: {
id: faker.string.uuid(),
},
},
},
{
title: 'when deleting with missing id',
context: {
input: {} as DeleteCommandMenuItemFactoryInput,
},
},
{
title: 'when deleting with empty id',
context: {
input: {
id: '',
},
},
},
{
title: 'when deleting with invalid id (not a UUID)',
context: {
input: {
id: 'not-a-valid-uuid',
},
},
},
];
describe('CommandMenuItem deletion should fail', () => {
it.each(eachTestingContextFilter(failingCommandMenuItemDeletionTestCases))(
'$title',
async ({ context }) => {
const { errors } = await deleteCommandMenuItem({
expectToFail: true,
input: context.input,
});
expectOneNotInternalServerErrorSnapshot({
errors,
});
},
);
});

View File

@@ -0,0 +1,127 @@
import { faker } from '@faker-js/faker';
import { expectOneNotInternalServerErrorSnapshot } from 'test/integration/graphql/utils/expect-one-not-internal-server-error-snapshot.util';
import { createCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item.util';
import { deleteCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item.util';
import { updateCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/update-command-menu-item.util';
import {
eachTestingContextFilter,
type EachTestingContext,
} from 'twenty-shared/testing';
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
import { type UpdateCommandMenuItemInput } from 'src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input';
type TestContext = {
input: (testSetup: TestSetup) => UpdateCommandMenuItemInput;
};
type TestSetup = {
testCommandMenuItemId: string;
};
describe('CommandMenuItem update should fail', () => {
let testCommandMenuItemId: string;
beforeEach(async () => {
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId: faker.string.uuid(),
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Command Menu Item To Update',
icon: 'IconOriginal',
isPinned: false,
},
});
testCommandMenuItemId = data.createCommandMenuItem.id;
});
afterEach(async () => {
if (testCommandMenuItemId) {
await deleteCommandMenuItem({
expectToFail: false,
input: { id: testCommandMenuItemId },
});
}
});
const failingCommandMenuItemUpdateTestCases: EachTestingContext<TestContext>[] =
[
{
title: 'when updating with empty label',
context: {
input: (testSetup) => ({
id: testSetup.testCommandMenuItemId,
label: '',
}),
},
},
{
title: 'when updating with missing id',
context: {
input: () =>
({
label: 'Updated Label',
}) as UpdateCommandMenuItemInput,
},
},
{
title: 'when updating with empty id',
context: {
input: () => ({
id: '',
label: 'Updated Label',
}),
},
},
{
title: 'when updating with invalid id (not a UUID)',
context: {
input: () => ({
id: 'not-a-valid-uuid',
label: 'Updated Label',
}),
},
},
{
title: 'when updating a non-existent command menu item',
context: {
input: () => ({
id: faker.string.uuid(),
label: 'Updated Label',
}),
},
},
{
title:
'when changing engineComponentKey to a standard key on an item with workflowVersionId',
context: {
input: (testSetup) => ({
id: testSetup.testCommandMenuItemId,
engineComponentKey: EngineComponentKey.GO_TO_PEOPLE,
}),
},
},
];
it.each(eachTestingContextFilter(failingCommandMenuItemUpdateTestCases))(
'$title',
async ({ context }) => {
const testSetup: TestSetup = {
testCommandMenuItemId,
};
const input = context.input(testSetup);
const { errors } = await updateCommandMenuItem({
expectToFail: true,
input,
});
expectOneNotInternalServerErrorSnapshot({
errors,
});
},
);
});

View File

@@ -0,0 +1,256 @@
import { faker } from '@faker-js/faker';
import { createCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item.util';
import { deleteCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item.util';
import { createFrontComponent } from 'test/integration/metadata/suites/front-component/utils/create-front-component.util';
import { deleteFrontComponent } from 'test/integration/metadata/suites/front-component/utils/delete-front-component.util';
import { seedBuiltFrontComponentFile } from 'test/integration/metadata/suites/front-component/utils/seed-built-front-component-file.util';
import { findManyObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata.util';
import { jestExpectToBeDefined } from 'test/utils/jest-expect-to-be-defined.util.test';
import { CommandMenuItemAvailabilityType } from 'twenty-shared/types';
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
describe('CommandMenuItem creation should succeed', () => {
let createdCommandMenuItemId: string;
let createdFrontComponentId: string | undefined;
let cleanupBuiltFile: (() => void) | undefined;
let companyObjectMetadataId: string;
let personObjectMetadataId: string;
beforeAll(async () => {
const { cleanup } = await seedBuiltFrontComponentFile({
builtComponentPath: 'src/front-components/index.mjs',
});
cleanupBuiltFile = cleanup;
const { objects } = await findManyObjectMetadata({
expectToFail: false,
input: {
filter: {},
paging: { first: 1000 },
},
gqlFields: `
id
nameSingular
`,
});
jestExpectToBeDefined(objects);
const companyObjectMetadata = objects.find(
(object: { nameSingular: string }) => object.nameSingular === 'company',
);
const personObjectMetadata = objects.find(
(object: { nameSingular: string }) => object.nameSingular === 'person',
);
jestExpectToBeDefined(companyObjectMetadata);
jestExpectToBeDefined(personObjectMetadata);
companyObjectMetadataId = companyObjectMetadata.id;
personObjectMetadataId = personObjectMetadata.id;
});
afterAll(async () => {
cleanupBuiltFile?.();
});
afterEach(async () => {
if (createdCommandMenuItemId) {
await deleteCommandMenuItem({
expectToFail: false,
input: { id: createdCommandMenuItemId },
});
createdCommandMenuItemId = undefined as unknown as string;
}
if (createdFrontComponentId) {
await deleteFrontComponent({
expectToFail: false,
input: { id: createdFrontComponentId },
});
createdFrontComponentId = undefined;
}
});
it('should create a basic command menu item with minimal input', async () => {
const workflowVersionId = faker.string.uuid();
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Test Command Menu Item',
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
workflowVersionId,
label: 'Test Command Menu Item',
icon: null,
isPinned: false,
availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
availabilityObjectMetadataId: null,
});
});
it('should create command menu item with all optional fields', async () => {
const workflowVersionId = faker.string.uuid();
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Full Command Menu Item',
icon: 'IconSparkles',
isPinned: true,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: companyObjectMetadataId,
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
workflowVersionId,
label: 'Full Command Menu Item',
icon: 'IconSparkles',
isPinned: true,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: companyObjectMetadataId,
});
});
it('should create command menu item with BULK_RECORDS availability', async () => {
const workflowVersionId = faker.string.uuid();
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Bulk Records Command',
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: personObjectMetadataId,
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
workflowVersionId,
label: 'Bulk Records Command',
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: personObjectMetadataId,
});
});
it('should create command menu item with GLOBAL availability (default)', async () => {
const workflowVersionId = faker.string.uuid();
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Global Command',
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
workflowVersionId,
label: 'Global Command',
availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
});
});
it('should create NAVIGATION command menu item with path payload', async () => {
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
engineComponentKey: EngineComponentKey.NAVIGATION,
label: 'Go to Settings',
payload: { path: '/settings/accounts' },
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
engineComponentKey: EngineComponentKey.NAVIGATION,
label: 'Go to Settings',
payload: {
path: '/settings/accounts',
},
});
});
it('should create NAVIGATION command menu item with navigationTargetObjectMetadataId', async () => {
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
engineComponentKey: EngineComponentKey.NAVIGATION,
label: 'Go to Companies',
navigationTargetObjectMetadataId: companyObjectMetadataId,
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
engineComponentKey: EngineComponentKey.NAVIGATION,
label: 'Go to Companies',
navigationTargetObjectMetadataId: companyObjectMetadataId,
payload: null,
});
});
it('should create command menu item with frontComponentId', async () => {
const { data: frontComponentData } = await createFrontComponent({
expectToFail: false,
input: {
name: 'Test Front Component',
componentName: 'TestFrontComponent',
sourceComponentPath: 'src/front-components/index.tsx',
builtComponentPath: 'src/front-components/index.mjs',
builtComponentChecksum: 'abc123',
},
});
createdFrontComponentId = frontComponentData?.createFrontComponent?.id;
jestExpectToBeDefined(createdFrontComponentId);
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
frontComponentId: createdFrontComponentId,
engineComponentKey: EngineComponentKey.FRONT_COMPONENT_RENDERER,
label: 'Front Component Command',
},
});
createdCommandMenuItemId = data?.createCommandMenuItem?.id;
expect(data.createCommandMenuItem).toMatchObject({
id: expect.any(String),
frontComponentId: createdFrontComponentId,
label: 'Front Component Command',
frontComponent: {
id: createdFrontComponentId,
name: 'Test Front Component',
},
});
});
});

View File

@@ -0,0 +1,44 @@
import { faker } from '@faker-js/faker';
import { createCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item.util';
import { deleteCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item.util';
import { findCommandMenuItems } from 'test/integration/metadata/suites/command-menu-item/utils/find-command-menu-items.util';
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
describe('CommandMenuItem deletion should succeed', () => {
it('should delete an existing command menu item', async () => {
const workflowVersionId = faker.string.uuid();
const { data: createData } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Command Menu Item To Delete',
},
});
const createdId = createData.createCommandMenuItem.id;
const { data: deleteData } = await deleteCommandMenuItem({
expectToFail: false,
input: { id: createdId },
});
expect(deleteData.deleteCommandMenuItem).toMatchObject({
id: createdId,
label: 'Command Menu Item To Delete',
});
const { data: findData } = await findCommandMenuItems({
expectToFail: false,
input: undefined,
});
const deletedItem = findData.commandMenuItems.find(
(item) => item.id === createdId,
);
expect(deletedItem).toBeUndefined();
});
});

View File

@@ -0,0 +1,157 @@
import { faker } from '@faker-js/faker';
import { createCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item.util';
import { deleteCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item.util';
import { findManyObjectMetadata } from 'test/integration/metadata/suites/object-metadata/utils/find-many-object-metadata.util';
import { updateCommandMenuItem } from 'test/integration/metadata/suites/command-menu-item/utils/update-command-menu-item.util';
import { jestExpectToBeDefined } from 'test/utils/jest-expect-to-be-defined.util.test';
import { CommandMenuItemAvailabilityType } from 'twenty-shared/types';
import { EngineComponentKey } from 'src/engine/metadata-modules/command-menu-item/enums/engine-component-key.enum';
describe('CommandMenuItem update should succeed', () => {
let createdCommandMenuItemId: string;
let companyObjectMetadataId: string;
let personObjectMetadataId: string;
beforeAll(async () => {
const { objects } = await findManyObjectMetadata({
expectToFail: false,
input: {
filter: {},
paging: { first: 1000 },
},
gqlFields: `
id
nameSingular
`,
});
jestExpectToBeDefined(objects);
const companyObjectMetadata = objects.find(
(object: { nameSingular: string }) => object.nameSingular === 'company',
);
const personObjectMetadata = objects.find(
(object: { nameSingular: string }) => object.nameSingular === 'person',
);
jestExpectToBeDefined(companyObjectMetadata);
jestExpectToBeDefined(personObjectMetadata);
companyObjectMetadataId = companyObjectMetadata.id;
personObjectMetadataId = personObjectMetadata.id;
});
beforeEach(async () => {
const workflowVersionId = faker.string.uuid();
const { data } = await createCommandMenuItem({
expectToFail: false,
input: {
workflowVersionId,
engineComponentKey: EngineComponentKey.TRIGGER_WORKFLOW_VERSION,
label: 'Original Label',
icon: 'IconOriginal',
isPinned: false,
availabilityType: CommandMenuItemAvailabilityType.GLOBAL,
},
});
createdCommandMenuItemId = data.createCommandMenuItem.id;
});
afterEach(async () => {
if (createdCommandMenuItemId) {
await deleteCommandMenuItem({
expectToFail: false,
input: { id: createdCommandMenuItemId },
});
createdCommandMenuItemId = undefined as unknown as string;
}
});
it('should update the label', async () => {
const { data } = await updateCommandMenuItem({
expectToFail: false,
input: {
id: createdCommandMenuItemId,
label: 'Updated Label',
},
});
expect(data.updateCommandMenuItem).toMatchObject({
id: createdCommandMenuItemId,
label: 'Updated Label',
});
});
it('should update the icon', async () => {
const { data } = await updateCommandMenuItem({
expectToFail: false,
input: {
id: createdCommandMenuItemId,
icon: 'IconUpdated',
},
});
expect(data.updateCommandMenuItem).toMatchObject({
id: createdCommandMenuItemId,
icon: 'IconUpdated',
});
});
it('should update isPinned', async () => {
const { data } = await updateCommandMenuItem({
expectToFail: false,
input: {
id: createdCommandMenuItemId,
isPinned: true,
},
});
expect(data.updateCommandMenuItem).toMatchObject({
id: createdCommandMenuItemId,
isPinned: true,
});
});
it('should update availabilityType and availabilityObjectMetadataId', async () => {
const { data } = await updateCommandMenuItem({
expectToFail: false,
input: {
id: createdCommandMenuItemId,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: companyObjectMetadataId,
},
});
expect(data.updateCommandMenuItem).toMatchObject({
id: createdCommandMenuItemId,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: companyObjectMetadataId,
});
});
it('should update multiple fields at once', async () => {
const { data } = await updateCommandMenuItem({
expectToFail: false,
input: {
id: createdCommandMenuItemId,
label: 'Fully Updated Label',
icon: 'IconNew',
isPinned: true,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: personObjectMetadataId,
},
});
expect(data.updateCommandMenuItem).toMatchObject({
id: createdCommandMenuItemId,
label: 'Fully Updated Label',
icon: 'IconNew',
isPinned: true,
availabilityType: CommandMenuItemAvailabilityType.RECORD_SELECTION,
availabilityObjectMetadataId: personObjectMetadataId,
});
});
});

View File

@@ -0,0 +1,47 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
import { type CreateCommandMenuItemInput } from 'src/engine/metadata-modules/command-menu-item/dtos/create-command-menu-item.input';
export type CreateCommandMenuItemFactoryInput = CreateCommandMenuItemInput;
const DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS = `
id
workflowVersionId
frontComponentId
frontComponent {
id
name
}
engineComponentKey
label
icon
isPinned
availabilityType
availabilityObjectMetadataId
navigationTargetObjectMetadataId
payload {
... on PathCommandMenuItemPayload {
path
}
}
applicationId
createdAt
updatedAt
`;
export const createCommandMenuItemQueryFactory = ({
input,
gqlFields = DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS,
}: PerformMetadataQueryParams<CreateCommandMenuItemFactoryInput>) => ({
query: gql`
mutation CreateCommandMenuItem($input: CreateCommandMenuItemInput!) {
createCommandMenuItem(input: $input) {
${gqlFields}
}
}
`,
variables: {
input,
},
});

View File

@@ -0,0 +1,43 @@
import {
type CreateCommandMenuItemFactoryInput,
createCommandMenuItemQueryFactory,
} from 'test/integration/metadata/suites/command-menu-item/utils/create-command-menu-item-query-factory.util';
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 { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.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 { type CommandMenuItemDTO } from 'src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto';
export const createCommandMenuItem = async ({
input,
gqlFields,
expectToFail = false,
token,
}: PerformMetadataQueryParams<CreateCommandMenuItemFactoryInput>): CommonResponseBody<{
createCommandMenuItem: CommandMenuItemDTO;
}> => {
const graphqlOperation = createCommandMenuItemQueryFactory({
input,
gqlFields,
});
const response = await makeMetadataAPIRequest(graphqlOperation, token);
if (expectToFail === true) {
warnIfNoErrorButExpectedToFail({
response,
errorMessage: 'CommandMenuItem creation should have failed but did not',
});
}
if (expectToFail === false) {
warnIfErrorButNotExpectedToFail({
response,
errorMessage: 'CommandMenuItem creation has failed but should not',
});
}
return { data: response.body.data, errors: response.body.errors };
};

View File

@@ -0,0 +1,27 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
export type DeleteCommandMenuItemFactoryInput = {
id: string;
};
const DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS = `
id
label
`;
export const deleteCommandMenuItemQueryFactory = ({
input,
gqlFields = DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS,
}: PerformMetadataQueryParams<DeleteCommandMenuItemFactoryInput>) => ({
query: gql`
mutation DeleteCommandMenuItem($id: UUID!) {
deleteCommandMenuItem(id: $id) {
${gqlFields}
}
}
`,
variables: {
id: input.id,
},
});

View File

@@ -0,0 +1,43 @@
import {
type DeleteCommandMenuItemFactoryInput,
deleteCommandMenuItemQueryFactory,
} from 'test/integration/metadata/suites/command-menu-item/utils/delete-command-menu-item-query-factory.util';
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 { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.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 { type CommandMenuItemDTO } from 'src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto';
export const deleteCommandMenuItem = async ({
input,
gqlFields,
expectToFail = false,
token,
}: PerformMetadataQueryParams<DeleteCommandMenuItemFactoryInput>): CommonResponseBody<{
deleteCommandMenuItem: CommandMenuItemDTO;
}> => {
const graphqlOperation = deleteCommandMenuItemQueryFactory({
input,
gqlFields,
});
const response = await makeMetadataAPIRequest(graphqlOperation, token);
if (expectToFail === true) {
warnIfNoErrorButExpectedToFail({
response,
errorMessage: 'CommandMenuItem deletion should have failed but did not',
});
}
if (expectToFail === false) {
warnIfErrorButNotExpectedToFail({
response,
errorMessage: 'CommandMenuItem deletion has failed but should not',
});
}
return { data: response.body.data, errors: response.body.errors };
};

View File

@@ -0,0 +1,34 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
const DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS = `
id
workflowVersionId
engineComponentKey
label
icon
isPinned
availabilityType
availabilityObjectMetadataId
navigationTargetObjectMetadataId
payload {
... on PathCommandMenuItemPayload {
path
}
}
applicationId
createdAt
updatedAt
`;
export const findCommandMenuItemsQueryFactory = ({
gqlFields = DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS,
}: PerformMetadataQueryParams<void>) => ({
query: gql`
query CommandMenuItems {
commandMenuItems {
${gqlFields}
}
}
`,
});

View File

@@ -0,0 +1,39 @@
import { findCommandMenuItemsQueryFactory } from 'test/integration/metadata/suites/command-menu-item/utils/find-command-menu-items-query-factory.util';
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 { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.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 { type CommandMenuItemDTO } from 'src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto';
export const findCommandMenuItems = async ({
gqlFields,
expectToFail = false,
token,
}: PerformMetadataQueryParams<void>): CommonResponseBody<{
commandMenuItems: CommandMenuItemDTO[];
}> => {
const graphqlOperation = findCommandMenuItemsQueryFactory({
input: undefined,
gqlFields,
});
const response = await makeMetadataAPIRequest(graphqlOperation, token);
if (expectToFail === true) {
warnIfNoErrorButExpectedToFail({
response,
errorMessage: 'CommandMenuItems query should have failed but did not',
});
}
if (expectToFail === false) {
warnIfErrorButNotExpectedToFail({
response,
errorMessage: 'CommandMenuItems query has failed but should not',
});
}
return { data: response.body.data, errors: response.body.errors };
};

View File

@@ -0,0 +1,42 @@
import gql from 'graphql-tag';
import { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.type';
import { type UpdateCommandMenuItemInput } from 'src/engine/metadata-modules/command-menu-item/dtos/update-command-menu-item.input';
export type UpdateCommandMenuItemFactoryInput = UpdateCommandMenuItemInput;
const DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS = `
id
workflowVersionId
engineComponentKey
label
icon
isPinned
availabilityType
availabilityObjectMetadataId
navigationTargetObjectMetadataId
payload {
... on PathCommandMenuItemPayload {
path
}
}
applicationId
createdAt
updatedAt
`;
export const updateCommandMenuItemQueryFactory = ({
input,
gqlFields = DEFAULT_COMMAND_MENU_ITEM_GQL_FIELDS,
}: PerformMetadataQueryParams<UpdateCommandMenuItemFactoryInput>) => ({
query: gql`
mutation UpdateCommandMenuItem($input: UpdateCommandMenuItemInput!) {
updateCommandMenuItem(input: $input) {
${gqlFields}
}
}
`,
variables: {
input,
},
});

View File

@@ -0,0 +1,43 @@
import {
type UpdateCommandMenuItemFactoryInput,
updateCommandMenuItemQueryFactory,
} from 'test/integration/metadata/suites/command-menu-item/utils/update-command-menu-item-query-factory.util';
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 { type PerformMetadataQueryParams } from 'test/integration/metadata/types/perform-metadata-query.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 { type CommandMenuItemDTO } from 'src/engine/metadata-modules/command-menu-item/dtos/command-menu-item.dto';
export const updateCommandMenuItem = async ({
input,
gqlFields,
expectToFail = false,
token,
}: PerformMetadataQueryParams<UpdateCommandMenuItemFactoryInput>): CommonResponseBody<{
updateCommandMenuItem: CommandMenuItemDTO;
}> => {
const graphqlOperation = updateCommandMenuItemQueryFactory({
input,
gqlFields,
});
const response = await makeMetadataAPIRequest(graphqlOperation, token);
if (expectToFail === true) {
warnIfNoErrorButExpectedToFail({
response,
errorMessage: 'CommandMenuItem update should have failed but did not',
});
}
if (expectToFail === false) {
warnIfErrorButNotExpectedToFail({
response,
errorMessage: 'CommandMenuItem update has failed but should not',
});
}
return { data: response.body.data, errors: response.body.errors };
};