Download mobile/src/utils/pairing/securePairingFeature.test.ts from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 1.54 kB
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/utils/pairing/securePairingFeature.test.ts
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/src/utils/pairing/securePairingFeature.test.ts
-
curl -L -o securePairingFeature.test.ts https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/utils/pairing/securePairingFeature.test.ts
1.54 kB
| import * as feature from "./securePairingFeature" | |
| import {advertisedSecurePairingCapable, parseOptionalBoolean} from "./securePairingFeature" | |
| describe("legacy Mentra Live capability flags", () => { | |
| it("keeps boolean flags and reads Expo Router strings", () => { | |
| expect(parseOptionalBoolean(false)).toBe(false) | |
| expect(parseOptionalBoolean("false")).toBe(false) | |
| expect(parseOptionalBoolean(true)).toBe(true) | |
| expect(parseOptionalBoolean("true")).toBe(true) | |
| expect(parseOptionalBoolean(undefined)).toBeUndefined() | |
| expect(parseOptionalBoolean("")).toBeUndefined() | |
| }) | |
| it("prefers the device payload over a missing or string route flag", () => { | |
| expect(advertisedSecurePairingCapable(undefined, false)).toBe(false) | |
| expect(advertisedSecurePairingCapable("false", undefined)).toBe(false) | |
| expect(advertisedSecurePairingCapable("true", false)).toBe(false) | |
| expect(advertisedSecurePairingCapable(undefined, undefined)).toBeUndefined() | |
| expect(advertisedSecurePairingCapable("true", undefined)).toBe(true) | |
| }) | |
| }) | |
| describe("Mentra Live pairing app flags", () => { | |
| it("exposes no app flag: the glasses' advertisement decides the pairing flow", () => { | |
| expect(feature).not.toHaveProperty("isMentraLiveSecurePairingEnabled") | |
| }) | |
| it("no longer exposes the retired ownership transfer flag", () => { | |
| expect(feature).not.toHaveProperty("isMentraLiveOwnershipTransferEnabled") | |
| expect(feature).not.toHaveProperty("isMentraLiveOwnershipTransferSupported") | |
| }) | |
| }) | |