From 01cd7a0ad377a80e1b21c19a04cf1d8777b6105a Mon Sep 17 00:00:00 2001 From: kyy Date: Fri, 5 Jun 2026 20:37:23 +0900 Subject: [PATCH] =?UTF-8?q?code-check=20=EC=98=A4=EB=A5=98=20=EC=88=98?= =?UTF-8?q?=EC=A0=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../users/UserListPage.render.test.tsx | 4 ++-- adminfront/tests/tenants.spec.ts | 8 ++++--- .../core/components/audit/AuditLogTable.tsx | 6 +++-- .../src/components/layout/AppLayout.test.tsx | 4 ++-- scripts/run_adminfront_ci_tests.sh | 22 ++++++++++--------- 5 files changed, 25 insertions(+), 19 deletions(-) diff --git a/adminfront/src/features/users/UserListPage.render.test.tsx b/adminfront/src/features/users/UserListPage.render.test.tsx index ec64d2f7..4975d072 100644 --- a/adminfront/src/features/users/UserListPage.render.test.tsx +++ b/adminfront/src/features/users/UserListPage.render.test.tsx @@ -127,7 +127,7 @@ describe("UserListPage search rendering", () => { renderUserListPage(); await screen.findByText("User 0"); - const searchInput = screen.getByPlaceholderText("이름 또는 이메일 검색..."); + const searchInput = screen.getByPlaceholderText("이름 또는 이메일 검색"); const renderCountBeforeTyping = selectRenderCounter.count; fireEvent.change(searchInput, { target: { value: "u" } }); @@ -179,7 +179,7 @@ describe("UserListPage search rendering", () => { renderUserListPage(); await screen.findByText("User 0"); - const searchInput = screen.getByPlaceholderText("이름 또는 이메일 검색..."); + const searchInput = screen.getByPlaceholderText("이름 또는 이메일 검색"); const startedAt = performance.now(); fireEvent.change(searchInput, { target: { value: "user 19" } }); diff --git a/adminfront/tests/tenants.spec.ts b/adminfront/tests/tenants.spec.ts index 71bbe54f..f6190262 100644 --- a/adminfront/tests/tenants.spec.ts +++ b/adminfront/tests/tenants.spec.ts @@ -107,7 +107,9 @@ test.describe("Tenants Management", () => { await expect(page.locator("table")).toContainText("Tenant A", { timeout: 10000, }); - await expect(page.locator("table")).toContainText(internalTenantId); + await expect( + page.getByTestId(`tenant-internal-id-${internalTenantId}`), + ).toHaveText("c5839444-2de0-4a37-99b0-..."); await expect(page.locator("table")).toContainText("COMPANY"); await expect(page.locator("table")).not.toContainText("일반 기업"); @@ -291,8 +293,8 @@ test.describe("Tenants Management", () => { await page.getByPlaceholder(/UUID|슬러그|slug/i).fill(""); await page.keyboard.press("Enter"); await page - .locator("tbody tr") - .filter({ hasText: "Acme" }) + .getByTestId("tenant-internal-id-company-1") + .locator("xpath=ancestor::tr") .getByRole("checkbox") .click(); diff --git a/common/core/components/audit/AuditLogTable.tsx b/common/core/components/audit/AuditLogTable.tsx index 30d94c0c..42c4371e 100644 --- a/common/core/components/audit/AuditLogTable.tsx +++ b/common/core/components/audit/AuditLogTable.tsx @@ -1,7 +1,9 @@ import { ChevronDown, ChevronUp, Copy } from "lucide-react"; import * as React from "react"; -import { getCommonBadgeClasses } from "../../../ui/badge"; -import type { CommonBadgeVariant } from "../../../ui/badge"; +import { + getCommonBadgeClasses, + type CommonBadgeVariant, +} from "../../../ui/badge"; import { getCommonButtonClasses } from "../../../ui/button"; import { commonStickyTableHeaderClass, diff --git a/devfront/src/components/layout/AppLayout.test.tsx b/devfront/src/components/layout/AppLayout.test.tsx index c4167588..563ffa94 100644 --- a/devfront/src/components/layout/AppLayout.test.tsx +++ b/devfront/src/components/layout/AppLayout.test.tsx @@ -120,7 +120,7 @@ describe("devfront AppLayout", () => { const container = await renderLayout(); const collapseButton = container.querySelector( - 'button[aria-label="Collapse sidebar"]', + 'button[aria-label="사이드바 접기"]', ) as HTMLButtonElement; await act(async () => { collapseButton.click(); @@ -130,7 +130,7 @@ describe("devfront AppLayout", () => { "true", ); expect( - container.querySelector('button[aria-label="Expand sidebar"]'), + container.querySelector('button[aria-label="사이드바 펼치기"]'), ).not.toBeNull(); }); diff --git a/scripts/run_adminfront_ci_tests.sh b/scripts/run_adminfront_ci_tests.sh index e524b8f4..8b18f035 100755 --- a/scripts/run_adminfront_ci_tests.sh +++ b/scripts/run_adminfront_ci_tests.sh @@ -128,8 +128,9 @@ run_with_retry() { return "$exit_code" } -playwright_install_cmd=(npx playwright install) -playwright_install_desc="npx playwright install" +playwright_cli="$repo_root/node_modules/.pnpm/@playwright+test@1.60.0/node_modules/@playwright/test/cli.js" +playwright_install_cmd=(node "$playwright_cli" install) +playwright_install_desc="node $playwright_cli install" playwright_project_args=() has_webkit_host_dependencies() { @@ -179,21 +180,21 @@ has_webkit_host_dependencies() { } if [ "$(id -u)" -eq 0 ]; then - playwright_install_cmd=(npx playwright install --with-deps) - playwright_install_desc="npx playwright install --with-deps" + playwright_install_cmd=(node "$playwright_cli" install --with-deps) + playwright_install_desc="node $playwright_cli install --with-deps" elif command -v sudo >/dev/null 2>&1 && sudo -n true >/dev/null 2>&1; then - playwright_install_cmd=(npx playwright install --with-deps) - playwright_install_desc="npx playwright install --with-deps" + playwright_install_cmd=(node "$playwright_cli" install --with-deps) + playwright_install_desc="node $playwright_cli install --with-deps" elif ! has_webkit_host_dependencies; then - playwright_install_cmd=(npx playwright install chromium firefox) - playwright_install_desc="npx playwright install chromium firefox" + playwright_install_cmd=(node "$playwright_cli" install chromium firefox) + playwright_install_desc="node $playwright_cli install chromium firefox" playwright_project_args=(--project=chromium --project=firefox) { echo "# Adminfront WebKit Skipped" echo echo "- Reason: WebKit host dependencies are not installed and this user cannot run passwordless sudo." echo "- Action: Running Chromium and Firefox projects only." - echo "- To enable WebKit locally: run \`cd adminfront && npx playwright install-deps webkit\` with sudo privileges." + echo "- To enable WebKit locally: run \`cd adminfront && node $playwright_cli install-deps webkit\` with sudo privileges." } > reports/adminfront-webkit-skipped.md fi @@ -295,10 +296,11 @@ if ! is_port_available "$port"; then port="$fallback_port" fi echo "==> adminfront using PORT=$port" +playwright_test_cli="$tmp_dir/adminfront/node_modules/.pnpm/@playwright+test@1.60.0/node_modules/@playwright/test/cli.js" ( cd "$tmp_dir/adminfront" CI=true PORT="$port" PLAYWRIGHT_WORKERS="${PLAYWRIGHT_WORKERS:-1}" \ - pnpm exec playwright test --max-failures=1 "${playwright_project_args[@]}" + node "$playwright_test_cli" test --max-failures=1 "${playwright_project_args[@]}" ) 2>&1 | tee reports/adminfront-test.log test_exit_code=${PIPESTATUS[0]} set -e