Files
twenty_crm/packages/twenty-server/test/integration/graphql/suites/object-generated/notes.integration-spec.ts
Charles Bochet fdc6705a75 Remove old body on note and tasks (#13290)
Fixes: https://github.com/twentyhq/twenty/issues/13110

I'm deprecating note.body and task.body to remove confusion between body
and bodyV2

What will be left but should be done later to avoid breaking changes:
- re-add a body field in the graphql API only that points to the same
bodyV2 field in SQL (need to be handled in fields and filter for note
and task)
- (wait some time)
- remove bodyV2 field
2025-07-19 11:25:49 +02:00

61 lines
1.5 KiB
TypeScript

import request from 'supertest';
const client = request(`http://localhost:${APP_PORT}`);
describe('notesResolver (e2e)', () => {
it('should find many notes', () => {
const queryData = {
query: `
query notes {
notes {
edges {
node {
position
title
bodyV2 {
markdown
blocknote
}
id
createdAt
updatedAt
deletedAt
}
}
}
}
`,
};
return client
.post('/graphql')
.set('Authorization', `Bearer ${APPLE_JANE_ADMIN_ACCESS_TOKEN}`)
.send(queryData)
.expect(200)
.expect((res) => {
expect(res.body.data).toBeDefined();
expect(res.body.errors).toBeUndefined();
})
.expect((res) => {
const data = res.body.data.notes;
expect(data).toBeDefined();
expect(Array.isArray(data.edges)).toBe(true);
const edges = data.edges;
if (edges.length > 0) {
const notes = edges[0].node;
expect(notes).toHaveProperty('position');
expect(notes).toHaveProperty('title');
expect(notes).toHaveProperty('bodyV2');
expect(notes).toHaveProperty('id');
expect(notes).toHaveProperty('createdAt');
expect(notes).toHaveProperty('updatedAt');
expect(notes).toHaveProperty('deletedAt');
}
});
});
});