mirror of
https://github.com/binaricat/Netcatty.git
synced 2026-09-24 15:49:09 +00:00
4e794d4af1
The lock screen is a full-window overlay, so it covers the title-bar drag region and is the only chrome on a locked first paint. Mark the backdrop as app-drag and keep unlock controls app-no-drag. Closes #3058
26 lines
933 B
TypeScript
26 lines
933 B
TypeScript
import assert from "node:assert/strict";
|
|
import { readFileSync } from "node:fs";
|
|
import test from "node:test";
|
|
|
|
import {
|
|
getAppLockErrorMessageKey,
|
|
} from "./AppLockOverlay.tsx";
|
|
|
|
test("getAppLockErrorMessageKey maps unlock errors to localized message keys", () => {
|
|
assert.equal(getAppLockErrorMessageKey("empty"), "appLock.error.emptyPassword");
|
|
assert.equal(getAppLockErrorMessageKey("incorrect"), "appLock.error.incorrectPassword");
|
|
assert.equal(getAppLockErrorMessageKey(null), null);
|
|
});
|
|
|
|
test("AppLockOverlay marks the backdrop as a window drag region", () => {
|
|
const source = readFileSync(new URL("./AppLockOverlay.tsx", import.meta.url), "utf8");
|
|
assert.match(
|
|
source,
|
|
/className="fixed inset-0 flex items-center justify-center bg-background px-6 text-foreground app-drag"/,
|
|
);
|
|
assert.match(
|
|
source,
|
|
/className="flex w-full max-w-\[360px\] flex-col items-center gap-5 app-no-drag"/,
|
|
);
|
|
});
|