Download mobile/src/utils/notificationBlocklist.test.ts from Anirudh1950/MentraOS: direct link, hf CLI and curl.
- Browser
- Download file 879 Bytes
-
https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/utils/notificationBlocklist.test.ts
- Command line
-
hf download hf://Anirudh1950/MentraOS/mobile/src/utils/notificationBlocklist.test.ts
-
curl -L -o notificationBlocklist.test.ts https://huggingface.co/Anirudh1950/MentraOS/resolve/main/mobile/src/utils/notificationBlocklist.test.ts
879 Bytes
| import {setPackagesBlocked} from "./notificationBlocklist" | |
| describe("setPackagesBlocked", () => { | |
| it("blocks every listed package and keeps existing entries", () => { | |
| expect(setPackagesBlocked(["com.old"], ["com.a", "com.b"], true)).toEqual(["com.old", "com.a", "com.b"]) | |
| }) | |
| it("does not duplicate packages that were already blocked", () => { | |
| expect(setPackagesBlocked(["com.a", "com.a"], ["com.a", "com.b"], true)).toEqual(["com.a", "com.b"]) | |
| }) | |
| it("unblocks only the listed packages", () => { | |
| expect(setPackagesBlocked(["com.a", "com.hidden", "com.b"], ["com.a", "com.b"], false)).toEqual(["com.hidden"]) | |
| }) | |
| it("leaves the blocklist unchanged for an empty selection", () => { | |
| expect(setPackagesBlocked(["com.a"], [], true)).toEqual(["com.a"]) | |
| expect(setPackagesBlocked(["com.a"], [], false)).toEqual(["com.a"]) | |
| }) | |
| }) | |