From e57294d35d4681925f14a8313d7703733092ab11 Mon Sep 17 00:00:00 2001 From: Purnima T Date: Mon, 9 Dec 2024 18:20:09 +0000 Subject: [PATCH] Integration test collaborators (#156) * Integration test collaborators * Fix format of mentorship/overview --- .../tests/cms/collaborators.test.ts | 12 ++++++++++++ .../tests/cms/mentorshipoverview.test.ts | 19 ++++++++++--------- 2 files changed, 22 insertions(+), 9 deletions(-) create mode 100644 integration-test/tests/cms/collaborators.test.ts diff --git a/integration-test/tests/cms/collaborators.test.ts b/integration-test/tests/cms/collaborators.test.ts new file mode 100644 index 00000000..b4c61f45 --- /dev/null +++ b/integration-test/tests/cms/collaborators.test.ts @@ -0,0 +1,12 @@ +import {expect, test} from '@playwright/test'; + +test('GET /api/cms/v1/collaborators returns correct data', async ({request}) => { + const response = await request.get('/api/cms/v1/collaborators'); + expect(response.status()).toBe(200); + expect(response).toBeDefined(); + const data = await response.json(); + expect(data.page).toBeDefined(); + expect(data.page.title).toBe('Team'); + expect(data.contact).toBeDefined(); + expect(data.contact.title).toBe('Contact us'); +}); \ No newline at end of file diff --git a/integration-test/tests/cms/mentorshipoverview.test.ts b/integration-test/tests/cms/mentorshipoverview.test.ts index f1ad20d1..bf46665d 100644 --- a/integration-test/tests/cms/mentorshipoverview.test.ts +++ b/integration-test/tests/cms/mentorshipoverview.test.ts @@ -1,12 +1,13 @@ import {expect, test} from '@playwright/test'; + test('GET /api/cms/v1/mentorship/overview returns correct data', async ({request}) => { -const response = await request.get('/api/cms/v1/mentorship/overview'); -expect(response.status()).toBe(200); -const data = await response.json(); -expect(data.page).toBeDefined(); -expect(data.page.title).toBe('Mentorship Programme'); -expect(data.mentorSection).toBeDefined(); -expect(data.mentorSection.title).toBe('Become a Mentor'); -expect(data.menteeSection).toBeDefined(); -expect(data.menteeSection.title).toBe('Become a Mentee'); + const response = await request.get('/api/cms/v1/mentorship/overview'); + expect(response.status()).toBe(200); + const data = await response.json(); + expect(data.page).toBeDefined(); + expect(data.page.title).toBe('Mentorship Programme'); + expect(data.mentorSection).toBeDefined(); + expect(data.mentorSection.title).toBe('Become a Mentor'); + expect(data.menteeSection).toBeDefined(); + expect(data.menteeSection.title).toBe('Become a Mentee'); });