Skip to content
Source
Sign inSign up
pingdotgg/t3code

feat: improve screen reader keyboard navigation #19669

Closedthienautran(GitHub profile, opens in a new tab)wants to merge 2 commits intomain fromrefs/pull/19669/headopened View on GitHub

Showing 63 changed files with 61 additions and 0 deletions (loading 60).

x
0 of 63 viewed, 63 left
31 additions and 0 deletionsapps/desktop/src/ipc/methods/accessibility.test.tsAdded
View file
@@ -0,0 +1,31 @@
+import * as Effect from "effect/Effect";
+import { beforeEach, vi } from "vite-plus/test";
+import { describe, expect, it } from "@effect/vitest";
+​
+const native = vi.hoisted(() => ({
+ enabled: false,
+ windows: [] as { isDestroyed: () => boolean; webContents: { send: ReturnType<typeof vi.fn> } }[],
+}));
+vi.mock("electron", () => ({
+ app: {
+ get accessibilitySupportEnabled() {
+ return native.enabled;
+ },
+ },
+ BrowserWindow: { getAllWindows: () => native.windows },
+}));
+import { getAccessibilitySupport } from "./accessibility.ts";
+​
+describe("desktop accessibility detection", () => {
+ beforeEach(() => {
+ native.enabled = false;
+ });
+ it.effect("reads the current native accessibility state without changing it", () =>
+ Effect.gen(function* () {
+ expect(yield* getAccessibilitySupport.handler(undefined)).toBe(false);
+ native.enabled = true;
+ expect(yield* getAccessibilitySupport.handler(undefined)).toBe(true);
+ expect(native.enabled).toBe(true);
+ }),
+ );