mirror of
https://github.com/freeCodeCamp/freeCodeCamp.git
synced 2026-05-28 18:26:54 +00:00
fix:(api): send full stack email for v9 (#64751)
Co-authored-by: Shaun Hamilton <shauhami020@gmail.com>
This commit is contained in:
@@ -1,44 +1,8 @@
|
||||
import { execSync } from 'child_process';
|
||||
import { test, expect, Page } from '@playwright/test';
|
||||
import translations from '../client/i18n/locales/english/translations.json';
|
||||
import { alertToBeVisible } from './utils/alerts';
|
||||
import {
|
||||
deleteAllEmails,
|
||||
getAllEmails,
|
||||
getFirstEmail,
|
||||
getSubject
|
||||
} from './utils/email';
|
||||
|
||||
test.describe('Claim a certification - almost certified user', () => {
|
||||
test.beforeEach(async () => {
|
||||
await deleteAllEmails();
|
||||
execSync('node ../tools/scripts/seed/seed-demo-user --unclaimed-user');
|
||||
});
|
||||
|
||||
test.afterAll(() => {
|
||||
execSync('node ../tools/scripts/seed/seed-demo-user --certified-user');
|
||||
});
|
||||
test.use({ storageState: 'playwright/.auth/certified-user.json' });
|
||||
|
||||
test('User receives a congratulations email on completing all certs', async ({
|
||||
page
|
||||
}) => {
|
||||
await page.goto('/settings#cert-front-end-development-libraries');
|
||||
await page
|
||||
.getByRole('button', {
|
||||
name: 'Claim Certification Front End Development Libraries V8'
|
||||
})
|
||||
.click();
|
||||
// verify that an email is sent
|
||||
await expect(async () => {
|
||||
const emails = await getAllEmails();
|
||||
expect(emails.messages).toHaveLength(1);
|
||||
expect(getSubject(getFirstEmail(emails))).toBe(
|
||||
'Congratulations on completing all of the freeCodeCamp certifications!'
|
||||
);
|
||||
}).toPass();
|
||||
});
|
||||
});
|
||||
// TODO: Include fullstack emails when claiming fullstack is implemented.
|
||||
|
||||
test.describe('Certification page - Non Microsoft', () => {
|
||||
test.beforeEach(async ({ page }) => {
|
||||
|
||||
Reference in New Issue
Block a user