mirror of
https://github.com/MBombeck/HealthLog.git
synced 2026-11-12 22:26:13 +00:00
fix(onboarding): show the closing AI line as body copy
The done screen's "AI is optional" line is a sentence the person reads, set in muted text, which the UI standards keep for meta. It is body text now. Its test asserted the absence of strings deleted from every bundle in the same change, so it could not fail; it now checks that the line is not muted, that the screen links to the AI settings once, and that no button sits beside the link.
This commit is contained in:
1 parent
706af61cdd
commit
55b223d4ed
2 files changed
+6
-9
No files matched your search
@@ -117,11 +117,11 @@ describe("<DoneScreen> AI line", () => {
|
||||
);
|
||||
expect(line).not.toBeNull();
|
||||
expect(line![1]).toContain("AI is optional");
|
||||
expect(line![1]).toContain('href="/settings/ai"');
|
||||
// No sample briefing, no provider ladder, no one-tap offer.
|
||||
expect(html).not.toContain("Example");
|
||||
expect(html).not.toContain("Three ways to turn it on");
|
||||
expect(html).not.toMatch(/<button[^>]*>[^<]*Turn on/);
|
||||
// Body copy, not meta: the line is read, so it is not muted.
|
||||
expect(line![0]).not.toContain("text-muted-foreground");
|
||||
// One way on, the link, and no one-tap offer beside it.
|
||||
expect(html.split('href="/settings/ai"')).toHaveLength(2);
|
||||
expect(line![1]).not.toContain("<button");
|
||||
});
|
||||
|
||||
it("is left out when AI cannot be set up here", () => {
|
||||
|
||||
@@ -123,10 +123,7 @@ export function DoneScreen({ state }: { state: OnboardingStateDto }) {
|
||||
</div>
|
||||
|
||||
{showAiLine ? (
|
||||
<p
|
||||
data-slot="onboarding-ai-line"
|
||||
className="text-muted-foreground max-w-md text-sm"
|
||||
>
|
||||
<p data-slot="onboarding-ai-line" className="max-w-md text-sm">
|
||||
{t("onboarding.done.aiOptional")}{" "}
|
||||
<InlineAction asChild size="sm" className="underline">
|
||||
<Link href="/settings/ai">{t("onboarding.done.aiSetupCta")}</Link>
|
||||
|
||||
Reference in new issue
Block a user