Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[test] #669 클러스터 클릭 관련 TC 테스트 코드 수정 #670

Merged
merged 1 commit into from
Aug 29, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
26 changes: 6 additions & 20 deletions packages/view/tests/home.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,9 @@ test.describe("home", () => {
await expect(page).toHaveTitle(/Githru/);
});

test("when click cluster", async ({ page }) => {
await page.waitForSelector("[data-testid=cluster-graph__container]", { state: "attached" });

const childContainers = await page.$$("[data-testid=cluster-graph__container]");
test("opens detail container on cluster click", async ({ page }) => {
await page.waitForSelector(".cluster-graph__container", { state: "attached" });
const childContainers = await page.$$(".cluster-graph__container");

if (childContainers.length > CLICK_INDEX) {
await childContainers[CLICK_INDEX].scrollIntoViewIfNeeded();
Expand All @@ -23,22 +22,9 @@ test.describe("home", () => {
}

// waiting for changing
await page.waitForTimeout(1000);

const newChildContainers = await page.$$("[data-testid=cluster-graph__container]");

const targetIndexForCheck = CLICK_INDEX + 1;
const transformPositionForCheck = 10 + targetIndexForCheck * 50 + 220;
if (newChildContainers.length > targetIndexForCheck) {
const transformValue = await newChildContainers[targetIndexForCheck].getAttribute("transform");
await page.waitForTimeout(10000);

if (transformValue !== null) {
expect(transformValue).toBe(`translate(2, ${transformPositionForCheck})`);
} else {
throw new Error("Transform attribute not found");
}
} else {
throw new Error("Not enough child containers found");
}
const detailContainer = await page.waitForSelector(".detail__container");
expect(detailContainer).toBeTruthy();
});
});
Loading