DRY pass #2, batch 8: the Shared-with-me facet is tested once (#5372)

sharing.test.ts round-tripped shared=with_me, which facets.test.ts already
does with every facet; its unknown-value case moves there.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-10-08 15:08:38 -04:00
co-authored by Claude Opus 5.5
parent 45c286a71f
commit cba428461c
2 changed files with 4 additions and 14 deletions
+4
View File
@@ -21,4 +21,8 @@ describe("the board's filter URL", () => {
expect(facets).toEqual({}); expect(facets).toEqual({});
expect(facetCount(facets)).toBe(0); expect(facetCount(facets)).toBe(0);
}); });
it("ignores a shared value it doesn't know", () => {
expect(facetsFromQuery({ shared: "by_me" })).toEqual({});
});
}); });
-14
View File
@@ -1,7 +1,6 @@
import { describe, expect, it } from "vitest"; import { describe, expect, it } from "vitest";
import { canEditText, isOwnNote } from "./sharing"; import { canEditText, isOwnNote } from "./sharing";
import { facetCount, facetsFromQuery, facetsToQuery } from "./facets";
import type { Note } from "../stores/notes"; import type { Note } from "../stores/notes";
const note = (extra: Partial<Note>): Note => ({ ...({} as Note), ...extra }); const note = (extra: Partial<Note>): Note => ({ ...({} as Note), ...extra });
@@ -21,16 +20,3 @@ describe("how a note is held", () => {
expect(canEditText(note({ permission: "view" }))).toBe(false); expect(canEditText(note({ permission: "view" }))).toBe(false);
}); });
}); });
describe("the Shared with me facet", () => {
it("round-trips through the URL and counts as one filter", () => {
const facets = facetsFromQuery({ shared: "with_me" });
expect(facets).toEqual({ shared: "with_me" });
expect(facetsToQuery(facets)).toEqual({ shared: "with_me" });
expect(facetCount(facets)).toBe(1);
});
it("ignores a value it doesn't know", () => {
expect(facetsFromQuery({ shared: "by_me" })).toEqual({});
});
});