Skip to content
Merged
Show file tree
Hide file tree
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
36 changes: 36 additions & 0 deletions packages/e2e/src/tests/settings.spec.ts
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,42 @@ test.describe("Settings - Interface Tab", () => {
});
});

test("language picker menu opens fully visible (not clipped by the settings pane)", async ({
vortexWindow,
}) => {
await test.step("Open the language picker", async () => {
await vortexWindow.getByRole("button", { name: "English" }).first().click();
await expect(vortexWindow.getByRole("listbox")).toBeVisible();
});

await test.step("Verify the open menu is hit-testable at its corners", async () => {
const hits = await vortexWindow.getByRole("listbox").evaluate((menu) => {
// the e2e tsconfig has no DOM lib; type the in-page APIs structurally
interface InPageElement {
getBoundingClientRect(): { left: number; top: number; right: number; bottom: number };
closest(selector: string): InPageElement | null;
}
const el = menu as unknown as InPageElement;
const doc = (
globalThis as unknown as {
document: { elementFromPoint(x: number, y: number): InPageElement | null };
}
).document;
const r = el.getBoundingClientRect();
const points: Array<[number, number]> = [
[r.left + 4, r.top + 4],
[r.right - 4, r.top + 4],
[r.left + 4, Math.min(r.bottom - 4, r.top + 150)],
];
return points.map(([x, y]) => {
const hit = doc.elementFromPoint(x, y);
return hit !== null && hit.closest('[role="listbox"]') !== null;
});
});
expect(hits).toEqual([true, true, true]);
});
});

test("customisation toggles can be switched on and off", async ({ vortexWindow }) => {
const settings = new SettingsPage(vortexWindow);
const toggleCount = await settings.checkboxes.count();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,7 @@ class SettingsVortex extends ComponentEx<IProps, IComponentState> {
{ label: t("Shared"), value: "on" },
{ label: t("Per-User"), value: "off" },
]}
placement="left"
value={multiUser ? "on" : "off"}
onChange={this.selectMode}
/>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ class SettingsInterfaceImpl extends ComponentEx<IProps, {}> {
label: option.label,
value: option.id,
}))}
placement="left"
value={selectedLanguageId}
onChange={this.selectLanguage}
/>
Expand Down
1 change: 1 addition & 0 deletions src/renderer/src/extensions/updater/SettingsUpdate.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -124,6 +124,7 @@ class SettingsUpdate extends ComponentEx<IProps, ISettingsUpdateState> {
{ label: t("Beta"), value: "beta" },
{ label: t("No automatic updates"), value: "none" },
]}
placement="left"
value={updateChannel}
onChange={this.selectChannel}
/>
Expand Down
Loading