mirror of
https://github.com/dreamhunter2333/cloudflare_temp_email.git
synced 2026-05-06 20:32:55 +08:00
* feat: return address_id in /admin/new_address response - Add address_id field to newAddress function return type - Update CHANGELOG.md and CHANGELOG_EN.md Fixes #912 Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com> * test: verify address_id in new_address response * fix: add address_id validation and improve test coverage - Add null check for address_id after DB query - Change address_id to required field in return type - Add dedicated test for /admin/new_address endpoint - Update e2e helper return type to non-optional --------- Co-authored-by: Claude Opus 4.6 <noreply@anthropic.com>
20 lines
690 B
TypeScript
20 lines
690 B
TypeScript
import { test, expect } from '@playwright/test';
|
|
import { WORKER_URL, TEST_DOMAIN } from '../../fixtures/test-helpers';
|
|
|
|
test.describe('Admin New Address', () => {
|
|
test('should return address_id in response', async ({ request }) => {
|
|
const uniqueName = `admin-test${Date.now()}`;
|
|
const res = await request.post(`${WORKER_URL}/admin/new_address`, {
|
|
data: { name: uniqueName, domain: TEST_DOMAIN },
|
|
});
|
|
|
|
expect(res.ok()).toBe(true);
|
|
const body = await res.json();
|
|
|
|
expect(body.address).toContain('@' + TEST_DOMAIN);
|
|
expect(body.jwt).toBeTruthy();
|
|
expect(body.address_id).toBeGreaterThan(0);
|
|
expect(typeof body.address_id).toBe('number');
|
|
});
|
|
});
|