Cotton code
61 lines · 3.3 KB · TypeScriptRaw
// The store texts for Cotton Words, Days and Story (assets/store): the listings and the review notes the App Store and// Play read. What is held (coordinator, 22 Nov 2026): the apps' names; deleting an account takes 30 days and signing// in before then keeps it; Words says its Memory notes are readable wherever it says the servers cannot read (owner,// 16 Nov 2026: memory stays open); App Store text never names Android or Google Play (Apple 2.3.10); and the review// notes keep the number, code and recovery code as blanks, never a real value.import { existsSync, readFileSync } from "node:fs";import { dirname, join, resolve } from "node:path";import { fileURLToPath } from "node:url";import { describe, expect, it } from "vitest";const STORE = join(resolve(dirname(fileURLToPath(import.meta.url)), "../.."), "assets", "store");const read = (path: string) => readFileSync(join(STORE, path), "utf8");const APPS = { words: "Words", days: "Days", story: "Story" } as const;const texts: [string, string][] = Object.keys(APPS).flatMap((app) => [  [`appstore/${app}/description.txt`, read(`appstore/${app}/description.txt`)],  [`appstore/${app}/review_notes.txt`, read(`appstore/${app}/review_notes.txt`)],  [`play/${app}/metadata/en-US/full_description.txt`, read(`play/${app}/metadata/en-US/full_description.txt`)],  [`play/${app}/review_notes.txt`, read(`play/${app}/review_notes.txt`)],]);describe("the store texts for Words, Days and Story", () => {  it.each(Object.entries(APPS))("%s is named Cotton %s in both stores", (app, name) => {    expect(read(`appstore/${app}/name.txt`).trim()).toBe(`Cotton ${name}`);    expect(read(`play/${app}/metadata/en-US/title.txt`).trim()).toBe(`Cotton ${name}`);    expect(read(`appstore/${app}/copyright.txt`).trim()).toBe("2026 DECEMBERFM, INC");  });  it.each(texts)("%s uses no old name", (_path, text) => {    expect(text).not.toMatch(/Cotton (Notes|Calendar|Chat|Messages)\b/);  });  it.each(texts)("%s says deleting takes 30 days wherever it speaks of deleting the account", (_path, text) => {    if (!/delete (your|the) account|deleting your account|Delete account/i.test(text)) return;    expect(text).toMatch(/30 days/);    expect(text).not.toMatch(/deletes (it|the account) and everything in it, in every Cotton app/);  });  it.each(texts.filter(([p]) => p.includes("/words/")))("%s names the Memory notes wherever it says the servers cannot read", (_path, text) => {    if (!/cannot read/.test(text)) return;    expect(text).toMatch(/Memory/);  });  it.each(texts.filter(([p]) => p.startsWith("appstore/")))("%s never names Android or Google Play", (_path, text) => {    expect(text).not.toMatch(/Android|Google Play/);  });  it.each(texts.filter(([p]) => p.endsWith("review_notes.txt")))("%s keeps the number, code and recovery code as blanks", (_path, text) => {    for (const blank of ["[NUMBER]", "[CODE]", "[RECOVERY CODE]"]) expect(text).toContain(blank);    expect(text).not.toMatch(/\+\d[\d ()-]{6,}/);    expect(text.length).toBeLessThan(4000);  });  it("the store privacy answers exist for each app", () => {    for (const app of Object.keys(APPS)) {      expect(existsSync(join(STORE, `play/${app}/data_safety.md`))).toBe(true);      expect(existsSync(join(STORE, `appstore/${app}/privacy_labels.md`))).toBe(true);    }  });});