Refactor Study Desk application structure

This commit is contained in:
Elijah 2026-08-07 19:31:23 -07:00
parent faaccf8a7e
commit 089439ed90
145 changed files with 8087 additions and 3412 deletions

View file

@ -0,0 +1,34 @@
import { describe, expect, it } from "vitest";
import { buildShareMetadata, type ShareMetaLink } from "./shareMetadata";
describe("buildShareMetadata", () => {
const deckLink: ShareMetaLink = {
targetType: "DECK",
deck: {
name: "Deck",
description: null,
class: { slug: "class", name: "Class" },
_count: { cards: 3 },
},
quizSet: null,
group: null,
};
it("does not describe a token under a mismatched shared route type", () => {
expect(
buildShareMetadata(deckLink, {
classSlug: "class",
pathType: "quizzes",
}).title
).toBe("Study Desk");
});
it("describes the target only when token, class, and route type agree", () => {
expect(
buildShareMetadata(deckLink, {
classSlug: "class",
pathType: "flashcards",
}).title
).toContain("Deck");
});
});