1750 extensibility twenty sdk v2 use twenty sdk to define an object (#15230)
We maintain jsonc object definition but will deprecate them pretty soon ## Before <img width="1512" height="575" alt="image" src="https://github.com/user-attachments/assets/d2fa6ca4-c456-4aa9-a1e3-845b61839718" /> ## After <img width="1260" height="555" alt="image" src="https://github.com/user-attachments/assets/ba72f4cf-d443-4967-913c-029bc71f3f48" />
This commit is contained in:
@@ -0,0 +1,21 @@
|
||||
import { getDecoratedClass } from '../../utils/get-decorated-class';
|
||||
|
||||
describe('getDecoratedClass', () => {
|
||||
it('should return properly formatted class', () => {
|
||||
const result = getDecoratedClass({
|
||||
data: { nameSingular: 'Name', namePlural: 'Names' },
|
||||
name: 'MyNewObject',
|
||||
});
|
||||
|
||||
const expectedResult = `import { ObjectMetadata } from 'twenty-sdk';
|
||||
|
||||
@ObjectMetadata({
|
||||
nameSingular: 'Name',
|
||||
namePlural: 'Names',
|
||||
})
|
||||
export class MyNewObject {}
|
||||
`;
|
||||
|
||||
expect(result).toEqual(expectedResult);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user