From e66c67dfa7cba26bee8dd238cdb166c791127341 Mon Sep 17 00:00:00 2001 From: nimat1 Date: Sat, 7 Dec 2024 12:35:00 +0000 Subject: [PATCH 1/3] Integration test collaborators --- integration-test/tests/cms/collaborators.test.ts | 11 +++++++++++ 1 file changed, 11 insertions(+) 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..8c90360b --- /dev/null +++ b/integration-test/tests/cms/collaborators.test.ts @@ -0,0 +1,11 @@ +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 From 3d7e583a7308cce928cb76299c83fc966d2e320c Mon Sep 17 00:00:00 2001 From: nimat1 Date: Sun, 8 Dec 2024 10:25:57 +0000 Subject: [PATCH 2/3] Integration test collabrorators --- integration-test/tests/cms/collaborators.test.ts | 1 + 1 file changed, 1 insertion(+) diff --git a/integration-test/tests/cms/collaborators.test.ts b/integration-test/tests/cms/collaborators.test.ts index 8c90360b..dc3c724a 100644 --- a/integration-test/tests/cms/collaborators.test.ts +++ b/integration-test/tests/cms/collaborators.test.ts @@ -1,4 +1,5 @@ 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); From bd2aa2af9a280ada08a2a9380238c40f4c15b8ef Mon Sep 17 00:00:00 2001 From: nimat1 Date: Mon, 9 Dec 2024 18:12:05 +0000 Subject: [PATCH 3/3] Intergration test colloaborators --- .../tests/cms/collaborators.test.ts | 16 ++++++++-------- .../tests/cms/mentorshipoverview.test.ts | 19 ++++++++++--------- 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/integration-test/tests/cms/collaborators.test.ts b/integration-test/tests/cms/collaborators.test.ts index dc3c724a..b4c61f45 100644 --- a/integration-test/tests/cms/collaborators.test.ts +++ b/integration-test/tests/cms/collaborators.test.ts @@ -1,12 +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'); + 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'); });