1
0
forked from baron/baron-sso

병합 이후 검토 적용

This commit is contained in:
2026-06-15 20:28:10 +09:00
parent 202c783920
commit 35284d72ed
35 changed files with 996 additions and 62 deletions

View File

@@ -1,11 +1,9 @@
import { render, screen } from "@testing-library/react";
import userEvent from "@testing-library/user-event";
import { fireEvent, render, screen } from "@testing-library/react";
import { describe, expect, it, vi } from "vitest";
import { DomainTagInput } from "./DomainTagInput";
describe("DomainTagInput", () => {
it("shows a clear duplicate tenant warning and adds the domain after confirmation", async () => {
const user = userEvent.setup();
const onChange = vi.fn();
const onConfirmedConflictsChange = vi.fn();
@@ -34,10 +32,9 @@ describe("DomainTagInput", () => {
/>,
);
await user.type(
screen.getByPlaceholderText("example.com"),
"samaneng.com ",
);
const input = screen.getByPlaceholderText("example.com");
fireEvent.change(input, { target: { value: "samaneng.com" } });
fireEvent.keyDown(input, { key: " " });
expect(
await screen.findByText(
@@ -45,7 +42,7 @@ describe("DomainTagInput", () => {
),
).toBeInTheDocument();
await user.click(screen.getByRole("button", { name: "계속 진행" }));
fireEvent.click(screen.getByRole("button", { name: "계속 진행" }));
expect(onChange).toHaveBeenCalledWith(["samaneng.com"]);
expect(onConfirmedConflictsChange).toHaveBeenCalledWith(["samaneng.com"]);