-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Design system overhaul: unified tokens, component authority, standardized layout #1570
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
5e7e4e8
4d880ac
ceebcc5
84a48f2
cbacfb4
c8a515a
1f7de02
77abd47
74b834b
4782291
d2c856e
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -17,6 +17,7 @@ vi.mock("@tanstack/react-router", () => ({ | |
| createFileRoute: | ||
| () => | ||
| (config: { | ||
| beforeLoad?: (args: { params: { owner: string; slug: string } }) => unknown; | ||
| loader?: (args: { params: { owner: string; slug: string } }) => Promise<unknown>; | ||
| component?: unknown; | ||
| head?: unknown; | ||
|
|
@@ -31,6 +32,7 @@ vi.mock("../lib/skillPage", () => ({ | |
| async function loadRoute() { | ||
| return (await import("../routes/$owner/$slug")).Route as unknown as { | ||
| __config: { | ||
| beforeLoad?: (args: { params: { owner: string; slug: string } }) => unknown; | ||
| loader?: (args: { params: { owner: string; slug: string } }) => Promise<unknown>; | ||
| head?: (args: { | ||
| params: { owner: string; slug: string }; | ||
|
|
@@ -45,6 +47,14 @@ async function loadRoute() { | |
| }; | ||
| } | ||
|
|
||
| async function runBeforeLoad(params: { owner: string; slug: string }) { | ||
| const route = await loadRoute(); | ||
| const beforeLoad = route.__config.beforeLoad as ((args: { | ||
| params: { owner: string; slug: string }; | ||
| }) => unknown) | undefined; | ||
| return beforeLoad?.({ params }); | ||
| } | ||
|
|
||
| async function runLoader(params: { owner: string; slug: string }) { | ||
| const route = await loadRoute(); | ||
| const loader = route.__config.loader as (args: { | ||
|
|
@@ -71,6 +81,18 @@ function runHead( | |
| } | ||
|
|
||
| describe("skill route loader", () => { | ||
| it("allows numeric owner handles in beforeLoad", () => { | ||
| expect(() => runBeforeLoad({ owner: "123abc", slug: "weather" })).not.toThrow(); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Useful? React with 👍 / 👎. |
||
| }); | ||
|
|
||
| it("allows raw owner ids in beforeLoad", () => { | ||
| expect(() => runBeforeLoad({ owner: "users:abc123", slug: "weather" })).not.toThrow(); | ||
| }); | ||
|
|
||
| it("allows raw publisher ids in beforeLoad", () => { | ||
| expect(() => runBeforeLoad({ owner: "publishers:abc123", slug: "weather" })).not.toThrow(); | ||
| }); | ||
|
|
||
| beforeEach(() => { | ||
| fetchSkillPageDataMock.mockReset(); | ||
| }); | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The file now ends with
});});, which is a syntax error, so Vitest cannot parse this test module andbun run testwill fail before executing the suite. This blocks CI and hides regressions in unrelated tests until the extra});is removed.Useful? React with 👍 / 👎.