Skip to content

Commit

Permalink
Integration test collaborators (#156)
Browse files Browse the repository at this point in the history
* Integration test collaborators
* Fix format of mentorship/overview
  • Loading branch information
nimat1 authored Dec 9, 2024
1 parent 4555a60 commit e57294d
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 9 deletions.
12 changes: 12 additions & 0 deletions integration-test/tests/cms/collaborators.test.ts
Original file line number Diff line number Diff line change
@@ -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');
});
19 changes: 10 additions & 9 deletions integration-test/tests/cms/mentorshipoverview.test.ts
Original file line number Diff line number Diff line change
@@ -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');
});

0 comments on commit e57294d

Please sign in to comment.