This commit is contained in:
parent
6e3123091a
commit
aeddaa6972
69 changed files with 3178 additions and 424 deletions
|
|
@ -334,10 +334,28 @@ async function expectPracticalSettingsLayout(page: Page, mode: "desktop" | "mobi
|
|||
const railTitleRect = railTitle.getBoundingClientRect();
|
||||
const railCardRect = railCard.getBoundingClientRect();
|
||||
const navRect = nav.getBoundingClientRect();
|
||||
const navStyle = getComputedStyle(nav);
|
||||
const navItems = Array.from(nav.querySelectorAll<HTMLElement>(".vg-set__nav-item"));
|
||||
const accountStyle = getComputedStyle(account);
|
||||
const appearanceRect = appearance.getBoundingClientRect();
|
||||
const notifyRect = notify.getBoundingClientRect();
|
||||
const voiceRect = voice.getBoundingClientRect();
|
||||
const mobileNavItemsMeetContract = navItems.every((item) => {
|
||||
const rect = item.getBoundingClientRect();
|
||||
const label = item.querySelector<HTMLElement>("span");
|
||||
return (
|
||||
label !== null &&
|
||||
rect.height >= 44 &&
|
||||
item.scrollWidth <= item.clientWidth &&
|
||||
item.scrollHeight <= item.clientHeight &&
|
||||
label.scrollWidth <= label.clientWidth &&
|
||||
label.scrollHeight <= label.clientHeight &&
|
||||
rect.left >= navRect.left &&
|
||||
rect.right <= navRect.right &&
|
||||
rect.top >= navRect.top &&
|
||||
rect.bottom <= navRect.bottom
|
||||
);
|
||||
});
|
||||
|
||||
if (layoutMode === "desktop") {
|
||||
return {
|
||||
|
|
@ -355,7 +373,9 @@ async function expectPracticalSettingsLayout(page: Page, mode: "desktop" | "mobi
|
|||
rootSingleColumn: rootStyle.display !== "grid",
|
||||
formColumns,
|
||||
railCardHidden: railCardRect.height === 0,
|
||||
navSingleLine: navRect.height <= 54,
|
||||
navIsThreeColumnGrid:
|
||||
navStyle.display === "grid" && countColumns(navStyle.gridTemplateColumns) === 3,
|
||||
navItemsMeetContract: navItems.length > 0 && mobileNavItemsMeetContract,
|
||||
compactPanelPadding: Number.parseFloat(accountStyle.paddingTop) <= 14,
|
||||
};
|
||||
}, mode),
|
||||
|
|
@ -375,7 +395,8 @@ async function expectPracticalSettingsLayout(page: Page, mode: "desktop" | "mobi
|
|||
rootSingleColumn: true,
|
||||
formColumns: 1,
|
||||
railCardHidden: true,
|
||||
navSingleLine: true,
|
||||
navIsThreeColumnGrid: true,
|
||||
navItemsMeetContract: true,
|
||||
compactPanelPadding: true,
|
||||
},
|
||||
);
|
||||
|
|
@ -759,6 +780,9 @@ test.describe("settings page", () => {
|
|||
|
||||
await openSettings(page, { admin: true });
|
||||
|
||||
if (isMobile) {
|
||||
expect(page.viewportSize()?.width).toBeLessThanOrEqual(720);
|
||||
}
|
||||
await expectPracticalSettingsLayout(page, isMobile ? "mobile" : "desktop");
|
||||
await expectNoSettingsControlClipping(page);
|
||||
await expectNoHorizontalOverflow(page);
|
||||
|
|
@ -776,7 +800,22 @@ test.describe("settings page", () => {
|
|||
|
||||
const engine = page.locator("#set-engine");
|
||||
await expect(engine).toBeVisible();
|
||||
await expect(engine.getByLabel("AI 엔진 공급자").locator("option")).toHaveCount(6);
|
||||
await expect
|
||||
.poll(() =>
|
||||
engine
|
||||
.getByLabel("AI 엔진 공급자")
|
||||
.locator("option")
|
||||
.evaluateAll((options) => options.map((option) => option.getAttribute("value"))),
|
||||
)
|
||||
.toEqual([
|
||||
"claude_cli",
|
||||
"claude_api",
|
||||
"codex_cli",
|
||||
"agy_cli",
|
||||
"openai",
|
||||
"openrouter",
|
||||
"solar",
|
||||
]);
|
||||
await expectNoEngineSegmentClipping(page);
|
||||
await expect(engine.getByLabel("AI 연결 주소")).toBeVisible();
|
||||
await expect(engine.getByLabel("AI 연결 주소")).toHaveValue(engineConfig!.engine_url);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue