Create PageLayoutTab resolver and controller (#14284)

Closes https://github.com/twentyhq/core-team-issues/issues/1394
This commit is contained in:
Raphaël Bosi
2025-09-04 18:07:33 +02:00
committed by GitHub
parent 0f806126ac
commit 9746c3a787
38 changed files with 2241 additions and 32 deletions
@@ -0,0 +1,23 @@
import { type PageLayoutTabEntity } from 'src/engine/core-modules/page-layout/entities/page-layout-tab.entity';
export const cleanupPageLayoutTabRecords = async (): Promise<void> => {
// @ts-expect-error legacy noImplicitAny
await global.testDataSource.query(`DELETE from "core"."pageLayoutTab"`);
};
export const assertPageLayoutTabStructure = (
pageLayoutTab: PageLayoutTabEntity,
expectedFields?: Partial<PageLayoutTabEntity>,
) => {
expect(pageLayoutTab).toBeDefined();
expect(pageLayoutTab.id).toEqual(expect.any(String));
expect(pageLayoutTab.title).toEqual(expect.any(String));
expect(pageLayoutTab.position).toEqual(expect.any(Number));
expect(pageLayoutTab.pageLayoutId).toEqual(expect.any(String));
expect(pageLayoutTab.createdAt).toEqual(expect.any(String));
expect(pageLayoutTab.updatedAt).toEqual(expect.any(String));
if (expectedFields) {
expect(pageLayoutTab).toMatchObject(expectedFields);
}
};