Create PageLayoutTab resolver and controller (#14284)
Closes https://github.com/twentyhq/core-team-issues/issues/1394
This commit is contained in:
@@ -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);
|
||||
}
|
||||
};
|
||||
Reference in New Issue
Block a user