Files
SnapOtter/tests/unit/web/feedback-search-miss.test.ts
SnapOtterandGitHub c68297d5a4 feat: request a tool when home search finds nothing (#385)
Adds a prefilled 'Request a tool' affordance to the home search empty state and beneath weak results. Opens the in-app feedback dialog with a new search_miss source and a structured search_query when analytics is on; links to a prefilled GitHub Discussions (Ideas) post when off, so a request is never silently dropped. Reuses the existing feedback pipe, dialog, and analytics gate; no new storage. i18n across all 21 locales.
2026-07-01 18:50:55 +08:00

13 lines
485 B
TypeScript

import { describe, expect, it } from "vitest";
import { promptVariantForSource, surveyIdForSource } from "@/lib/feedback";
describe("feedback search_miss mappings", () => {
it("maps the search_miss source to its survey id", () => {
expect(surveyIdForSource("search_miss")).toBe("search-miss-v1");
});
it("defaults the search_miss prompt variant to the empty-results entry point", () => {
expect(promptVariantForSource("search_miss")).toBe("search-empty-v1");
});
});