mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-06-01 13:39:59 +08:00
23 lines
902 B
TypeScript
23 lines
902 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { WORKER_URL } from '../../fixtures/test-helpers';
|
|
|
|
test.describe('Health & Settings', () => {
|
|
test('GET /health_check returns OK', async ({ request }) => {
|
|
const res = await request.get(`${WORKER_URL}/health_check`);
|
|
expect(res.ok()).toBe(true);
|
|
expect(await res.text()).toBe('OK');
|
|
});
|
|
|
|
test('GET /open_api/settings returns correct domains and sendMail enabled', async ({ request }) => {
|
|
const res = await request.get(`${WORKER_URL}/open_api/settings`);
|
|
expect(res.ok()).toBe(true);
|
|
|
|
const settings = await res.json();
|
|
expect(settings.domains).toContain('test.example.com');
|
|
expect(settings.defaultDomains).toContain('test.example.com');
|
|
expect(settings.enableSendMail).toBe(true);
|
|
expect(settings.enableUserCreateEmail).toBe(true);
|
|
expect(settings.enableUserDeleteEmail).toBe(true);
|
|
});
|
|
});
|