mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 06:06:10 +00:00
fix(documents): say that turning auto-read on reaches back over the vault
The switch was described three times as applying to what you upload next. A genuine off-to-on flip also enqueues a pass over the documents already stored without a summary, capped at 200 per flip — scanned medical documents going to a third-party provider, from copy that reads as forward-looking only. Drop "newly uploaded" from the sub-label and give the disclosure the sentence it was missing, including the cap. Six locales. The behaviour is right and stays as it is; only the sentence changes. A guard pins the number in the copy to MAX_ENQUEUES_PER_RUN, so moving the cap without touching the copy fails.
This commit is contained in:
1 parent
189024cc00
commit
20824aa798
7 files changed
+49
-12
No files matched your search
@@ -1,4 +1,6 @@
|
||||
import { beforeEach, describe, expect, it, vi } from "vitest";
|
||||
import { readFileSync } from "node:fs";
|
||||
import { join } from "node:path";
|
||||
|
||||
/**
|
||||
* The auto-read catch-up pass.
|
||||
@@ -169,3 +171,38 @@ describe("enqueueSummaryCatchUp", () => {
|
||||
});
|
||||
});
|
||||
});
|
||||
|
||||
describe("the toggle copy discloses the catch-up", () => {
|
||||
const LOCALES = ["de", "en", "es", "fr", "it", "pl"] as const;
|
||||
|
||||
function autoReadCopy(locale: string): { subLabel: string; honesty: string } {
|
||||
const bundle = JSON.parse(
|
||||
readFileSync(
|
||||
join(__dirname, `../../../../messages/${locale}.json`),
|
||||
"utf8",
|
||||
),
|
||||
) as {
|
||||
settings: {
|
||||
ai: { autoRead: { subLabel: string; honesty: string } };
|
||||
};
|
||||
};
|
||||
return bundle.settings.ai.autoRead;
|
||||
}
|
||||
|
||||
it.each(LOCALES)(
|
||||
"%s does not promise the switch only applies to future uploads",
|
||||
(locale) => {
|
||||
// The flip enqueues a pass over documents ALREADY stored, so copy that
|
||||
// scopes the switch to newly uploaded documents understates its reach.
|
||||
const { subLabel } = autoReadCopy(locale);
|
||||
expect(subLabel).not.toMatch(
|
||||
/newly|neu hochgeladene|recién subidos|nouvellement téléversés|appena caricati|nowo przesłane/i,
|
||||
);
|
||||
},
|
||||
);
|
||||
|
||||
it.each(LOCALES)("%s names the retroactive pass and its cap", (locale) => {
|
||||
const { honesty } = autoReadCopy(locale);
|
||||
expect(honesty).toContain(String(MAX_ENQUEUES_PER_RUN));
|
||||
});
|
||||
});
|
||||
Reference in new issue
Block a user