mirror of
https://github.com/twentyhq/twenty.git
synced 2024-12-02 10:04:09 +03:00
64 lines
1.9 KiB
TypeScript
64 lines
1.9 KiB
TypeScript
|
import request from 'supertest';
|
||
|
|
||
|
const client = request(`http://localhost:${APP_PORT}`);
|
||
|
|
||
|
describe('calendarChannelEventAssociationsResolver (integration)', () => {
|
||
|
it('should find many calendarChannelEventAssociations', () => {
|
||
|
const queryData = {
|
||
|
query: `
|
||
|
query calendarChannelEventAssociations {
|
||
|
calendarChannelEventAssociations {
|
||
|
edges {
|
||
|
node {
|
||
|
eventExternalId
|
||
|
id
|
||
|
createdAt
|
||
|
updatedAt
|
||
|
deletedAt
|
||
|
calendarChannelId
|
||
|
calendarEventId
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
`,
|
||
|
};
|
||
|
|
||
|
return client
|
||
|
.post('/graphql')
|
||
|
.set('Authorization', `Bearer ${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.calendarChannelEventAssociations;
|
||
|
|
||
|
expect(data).toBeDefined();
|
||
|
expect(Array.isArray(data.edges)).toBe(true);
|
||
|
|
||
|
const edges = data.edges;
|
||
|
|
||
|
if (edges.length > 0) {
|
||
|
const calendarChannelEventAssociations = edges[0].node;
|
||
|
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty(
|
||
|
'eventExternalId',
|
||
|
);
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty('id');
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty('createdAt');
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty('updatedAt');
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty('deletedAt');
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty(
|
||
|
'calendarChannelId',
|
||
|
);
|
||
|
expect(calendarChannelEventAssociations).toHaveProperty(
|
||
|
'calendarEventId',
|
||
|
);
|
||
|
}
|
||
|
});
|
||
|
});
|
||
|
});
|