Files
twenty/packages/twenty-server/test/integration/metadata/suites/front-component/successful-front-component-update.integration-spec.ts
T
Charles Bochet 5fc4e810f7 Front Extensibility: Introduce Front Component Entity (#17175)
As part of the extensibility effort, we are introducing a new engine
entity called "Front Component". This represents a dynamic react
component that will be rendered in CommandMenu actions or in PageLayout
widgets

This PR introduce the entity and all the necessary boilerplate to make
it syncable and cachable in the engine
2026-01-16 17:23:46 +01:00

51 lines
1.5 KiB
TypeScript

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 { updateFrontComponent } from 'test/integration/metadata/suites/front-component/utils/update-front-component.util';
import { isDefined } from 'twenty-shared/utils';
describe('Front component update should succeed', () => {
let testFrontComponentId: string | undefined;
beforeEach(async () => {
const { data } = await createFrontComponent({
expectToFail: false,
input: {
name: 'testFrontComponentToUpdate',
},
});
testFrontComponentId = data.createFrontComponent.id;
});
afterEach(async () => {
if (isDefined(testFrontComponentId)) {
await deleteFrontComponent({
expectToFail: false,
input: { id: testFrontComponentId },
});
testFrontComponentId = undefined;
}
});
it('should update front component name', async () => {
if (!isDefined(testFrontComponentId)) {
throw new Error('testFrontComponentId should be defined');
}
const { data } = await updateFrontComponent({
expectToFail: false,
input: {
id: testFrontComponentId,
update: {
name: 'updatedFrontComponentName',
},
},
});
expect(data.updateFrontComponent).toMatchObject({
id: testFrontComponentId,
name: 'updatedFrontComponentName',
});
});
});