Files
twenty/packages/twenty-server/test/integration/utils/page-layout-tab-test.util.ts
T
Paul RastoinandGitHub 47a8a15598 Metadata modules for PageLayoutTab PageLayoutWidget (#16662)
# Introduction
Creating dedicated folders and module for both `page-layout-tab` and
`page-layout-widget`

The addition diff with deletion is due to the module being added
2025-12-18 11:15:29 +00:00

23 lines
909 B
TypeScript

import { type PageLayoutTabEntity } from 'src/engine/metadata-modules/page-layout-tab/entities/page-layout-tab.entity';
export const cleanupPageLayoutTabRecords = async (): Promise<void> => {
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);
}
};