세션 평가와 교수자 분석 보강
This commit is contained in:
parent
5c4ac04e06
commit
fe2796f05a
51 changed files with 4928 additions and 240 deletions
|
|
@ -93,6 +93,43 @@ async function expectReachableLearnerHomeLayout(page: import("@playwright/test")
|
|||
await expectNoHorizontalOverflow(page);
|
||||
}
|
||||
|
||||
async function expectPersonaCardsUseContentHeight(page: import("@playwright/test").Page) {
|
||||
const cards = await page.locator(".lh-persona").evaluateAll((items) =>
|
||||
items.map((item) => {
|
||||
const card = item as HTMLElement;
|
||||
const rect = card.getBoundingClientRect();
|
||||
const summary = card.querySelector<HTMLElement>(".lh-persona__summary");
|
||||
const body = card.querySelector<HTMLElement>(".lh-persona__body");
|
||||
const textNodes = Array.from(
|
||||
card.querySelectorAll<HTMLElement>(
|
||||
".lh-persona__name, .lh-persona__meta, .lh-persona__summary",
|
||||
),
|
||||
);
|
||||
const childBottom = Math.max(
|
||||
0,
|
||||
...textNodes.map((child) => child.getBoundingClientRect().bottom),
|
||||
);
|
||||
return {
|
||||
label: (card.textContent ?? "").replace(/\s+/g, " ").trim().slice(0, 90),
|
||||
height: Math.ceil(rect.height),
|
||||
bodyOverflow: body ? Math.ceil(body.scrollHeight - body.clientHeight) : 0,
|
||||
childBottomOverflow: Math.ceil(childBottom - rect.bottom),
|
||||
cardScrollOverflow: Math.ceil(card.scrollHeight - card.clientHeight),
|
||||
summaryOverflow: summary ? Math.ceil(summary.scrollHeight - summary.clientHeight) : 0,
|
||||
};
|
||||
}),
|
||||
);
|
||||
|
||||
const offenders = cards.filter(
|
||||
(card) =>
|
||||
card.bodyOverflow > 1 ||
|
||||
card.childBottomOverflow > 1 ||
|
||||
card.cardScrollOverflow > 1 ||
|
||||
card.summaryOverflow > 1,
|
||||
);
|
||||
expect(offenders, `Persona card text should fit its fluid-height card: ${JSON.stringify(cards)}`).toEqual([]);
|
||||
}
|
||||
|
||||
function learnerActivityHeading(page: import("@playwright/test").Page) {
|
||||
return page.locator(".lh-activity__head").getByText("기존 회기", { exact: true });
|
||||
}
|
||||
|
|
@ -161,6 +198,7 @@ test.describe("learner app shell and session launcher", () => {
|
|||
await expect(launcher.getByRole("option", { name: new RegExp(persona.code) })).toBeVisible();
|
||||
await expect(launcher.getByRole("option", { name: new RegExp(persona.display_name.replace(/[.*+?^${}()|[\]\\]/g, "\\$&")) })).toBeVisible();
|
||||
}
|
||||
await expectPersonaCardsUseContentHeight(page);
|
||||
|
||||
await expect(page.getByText(/12회/)).toHaveCount(0);
|
||||
await expect(page.getByText(/최근 연습/)).toHaveCount(0);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue