diff --git a/docs/ARCHITECTURE.md b/docs/ARCHITECTURE.md index 4da8dd8..2c66c03 100644 --- a/docs/ARCHITECTURE.md +++ b/docs/ARCHITECTURE.md @@ -517,7 +517,7 @@ Regular has a name `harness.Similar` to it — the PWA's copy of the name rules in `web/src/dinners/names.ts` folds letters with `web/src/dinners/letterFolds.json`, which `gen_folds.py` writes from the same table as the server's, and runs the same cases, -`internal/ai/harness/testdata/dedupe_cases.json`, as the server's) and +`web/src/dinners/testdata/dedupe_cases.json`, as the server's) and notifications (`/onboarding/notifications`: what MealQuest notifies about, the iOS install hint, "Turn on notifications" and "Maybe later"). Either button sends `PATCH /api/v1/settings/household` with diff --git a/internal/ai/harness/dedupe_test.go b/internal/ai/harness/dedupe_test.go index 9f7ff2b..8653385 100644 --- a/internal/ai/harness/dedupe_test.go +++ b/internal/ai/harness/dedupe_test.go @@ -8,11 +8,11 @@ import ( "unicode/utf8" ) -// TestSharedDedupeCases runs testdata/dedupe_cases.json, which the PWA's -// copy of Normalize and Similar (web/src/dinners/names.ts) runs too, so the -// two cannot drift apart on these names. +// TestSharedDedupeCases runs web/src/dinners/testdata/dedupe_cases.json, +// which the PWA's copy of Normalize and Similar (web/src/dinners/names.ts) +// runs too, so the two cannot drift apart on these names. func TestSharedDedupeCases(t *testing.T) { - raw, err := os.ReadFile("testdata/dedupe_cases.json") + raw, err := os.ReadFile("../../../web/src/dinners/testdata/dedupe_cases.json") if err != nil { t.Fatal(err) } diff --git a/web/src/dinners/names.test.ts b/web/src/dinners/names.test.ts index f2677fd..9ac8ac5 100644 --- a/web/src/dinners/names.test.ts +++ b/web/src/dinners/names.test.ts @@ -1,5 +1,5 @@ import { describe, expect, it } from 'vitest' -import cases from '../../../internal/ai/harness/testdata/dedupe_cases.json' +import cases from './testdata/dedupe_cases.json' import { normalizeName, similarNames } from './names.ts' // The cases internal/ai/harness's tests run against Normalize and Similar. diff --git a/web/src/dinners/names.ts b/web/src/dinners/names.ts index 52cc50d..9967834 100644 --- a/web/src/dinners/names.ts +++ b/web/src/dinners/names.ts @@ -1,7 +1,7 @@ // The PWA's copy of the server's dinner-name rules (internal/ai/harness // Normalize and Similar), so a screen can tell beforehand that the dinners // API would refuse a name as a duplicate. The server still decides. -// internal/ai/harness/testdata/dedupe_cases.json is run against both. +// web/src/dinners/testdata/dedupe_cases.json is run against both. import folds from './letterFolds.json' diff --git a/internal/ai/harness/testdata/dedupe_cases.json b/web/src/dinners/testdata/dedupe_cases.json similarity index 100% rename from internal/ai/harness/testdata/dedupe_cases.json rename to web/src/dinners/testdata/dedupe_cases.json