forked from baron/baron-sso
adminfront/devfront code-check 수정
This commit is contained in:
@@ -167,6 +167,20 @@ async function renderPage() {
|
||||
return container;
|
||||
}
|
||||
|
||||
async function waitForTextContent(container: HTMLElement, text: string) {
|
||||
for (let attempt = 0; attempt < 20; attempt += 1) {
|
||||
if (container.textContent?.includes(text)) {
|
||||
return;
|
||||
}
|
||||
|
||||
await act(async () => {
|
||||
await new Promise((resolve) => setTimeout(resolve, 0));
|
||||
});
|
||||
}
|
||||
|
||||
throw new Error(`Expected container text to include: ${text}`);
|
||||
}
|
||||
|
||||
describe("ClientsPage", () => {
|
||||
it("expands the list and applies search filters", async () => {
|
||||
fetchClientsMock.mockResolvedValue({
|
||||
@@ -300,7 +314,7 @@ describe("ClientsPage", () => {
|
||||
fetchDeveloperRequestStatusMock.mockResolvedValue({ status: "none" });
|
||||
|
||||
const container = await renderPage();
|
||||
expect(container.textContent).toContain("개발자 등록 신청하기");
|
||||
await waitForTextContent(container, "개발자 등록 신청하기");
|
||||
|
||||
const requestButton = Array.from(container.querySelectorAll("button")).find(
|
||||
(button) => button.textContent === "개발자 등록 신청하기",
|
||||
|
||||
Reference in New Issue
Block a user