From 38e81a751416726ac481bf06cf98e61e23619054 Mon Sep 17 00:00:00 2001 From: kjh2064 Date: Sat, 27 Jun 2026 21:18:29 +0900 Subject: [PATCH] =?UTF-8?q?test:=20=EB=AC=B8=EC=9D=98=20=EB=93=B1=EB=A1=9D?= =?UTF-8?q?=20e2e=20=EA=B2=80=EC=A6=9D=20=EB=B6=84=EB=A6=AC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/e2e/contact-submit.spec.ts | 23 +++++++++++++++++++---- 1 file changed, 19 insertions(+), 4 deletions(-) diff --git a/tests/e2e/contact-submit.spec.ts b/tests/e2e/contact-submit.spec.ts index e965086..af7d71d 100644 --- a/tests/e2e/contact-submit.spec.ts +++ b/tests/e2e/contact-submit.spec.ts @@ -6,7 +6,26 @@ const password = process.env.E2E_ADMIN_PASSWORD; const baseUrl = (process.env.E2E_BASE_URL ?? 'http://178.104.200.7/taxbaik').replace(/\/$/, ''); test.describe('contact submit', () => { + test('creates an inquiry through the public API', async ({ request }) => { + const stamp = Date.now(); + + const createResponse = await request.post(`${baseUrl}/api/inquiry`, { + data: { + name: `Public-${stamp}`, + phone: '010-1234-5678', + email: `public-${stamp}@example.com`, + serviceType: '기타', + message: 'Playwright로 전송한 공개 문의 테스트입니다.', + }, + }); + expect(createResponse.ok()).toBeTruthy(); + const createBody = await createResponse.json(); + expect(createBody.message).toContain('상담 신청이 접수되었습니다'); + }); + test('creates an inquiry and shows it in admin list', async ({ page, request }) => { + test.skip(!password, 'E2E_ADMIN_PASSWORD is required to verify the admin list.'); + const stamp = Date.now(); const name = `E2E-${stamp}`; const phone = '010-1234-5678'; @@ -23,10 +42,6 @@ test.describe('contact submit', () => { }, }); expect(createResponse.ok()).toBeTruthy(); - const createBody = await createResponse.json(); - expect(createBody.message).toContain('상담 신청이 접수되었습니다'); - - test.skip(!password, 'E2E_ADMIN_PASSWORD is required to verify the admin list.'); const token = await getAdminToken(request, baseUrl, username, password); await installAdminToken(page, token);