케이스 이어하기 UI와 공통 탭·이미지 복구를 반영
This commit is contained in:
parent
72353ecd82
commit
f1b80676c1
38 changed files with 3581 additions and 455 deletions
|
|
@ -279,6 +279,46 @@ async function expectMainControlsUnclipped(page: Page) {
|
|||
expect(failures, `Main session controls are clipped: ${JSON.stringify(failures)}`).toEqual([]);
|
||||
}
|
||||
|
||||
async function expectComposeControlsBottomAligned(page: Page) {
|
||||
const result = await page.evaluate(() => {
|
||||
const selectors = [
|
||||
".sx-compose textarea",
|
||||
".sx-coach-trigger-btn",
|
||||
".sx-compose .vg-btn",
|
||||
];
|
||||
const controls = selectors.map((selector) => {
|
||||
const element = document.querySelector<HTMLElement>(selector);
|
||||
if (!element) return null;
|
||||
const rect = element.getBoundingClientRect();
|
||||
return {
|
||||
selector,
|
||||
top: rect.top,
|
||||
bottom: rect.bottom,
|
||||
height: rect.height,
|
||||
};
|
||||
});
|
||||
if (controls.some((control) => control === null)) return null;
|
||||
|
||||
const resolvedControls = controls as Array<NonNullable<(typeof controls)[number]>>;
|
||||
const bottoms = resolvedControls.map((control) => control.bottom);
|
||||
return {
|
||||
delta: Math.max(...bottoms) - Math.min(...bottoms),
|
||||
controls: resolvedControls.map((control) => ({
|
||||
selector: control.selector,
|
||||
top: Math.round(control.top),
|
||||
bottom: Math.round(control.bottom),
|
||||
height: Math.round(control.height),
|
||||
})),
|
||||
};
|
||||
});
|
||||
|
||||
expect(result, "Expected text composer controls to be present").not.toBeNull();
|
||||
expect(
|
||||
result!.delta,
|
||||
`Expected text composer control bottoms to align: ${JSON.stringify(result!.controls)}`,
|
||||
).toBeLessThanOrEqual(1);
|
||||
}
|
||||
|
||||
async function expectRightPanelDoesNotIntersectSessionCore(page: Page) {
|
||||
const result = await page.evaluate(() => {
|
||||
const right = document.querySelector<HTMLElement>(".sx-page--active .sx-col-right");
|
||||
|
|
@ -500,6 +540,7 @@ test.describe("learner session full-screen layout", () => {
|
|||
await expectSessionControlsInsideViewport(page);
|
||||
await expectNoVisibleSessionPanelOverlap(page);
|
||||
await expectMainControlsUnclipped(page);
|
||||
await expectComposeControlsBottomAligned(page);
|
||||
await expectSessionPageHeightToMatchViewport(page);
|
||||
await expectActiveSessionUsableLayout(page);
|
||||
await expectRightPanelDoesNotIntersectSessionCore(page);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue