@jant/core 0.3.21 → 0.3.22
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/app.js +1 -1
- package/dist/index.js +8 -0
- package/dist/lib/feed.js +112 -0
- package/dist/lib/navigation.js +9 -9
- package/dist/lib/render.js +48 -0
- package/dist/lib/theme-components.js +18 -18
- package/dist/lib/view.js +228 -0
- package/dist/routes/api/timeline.js +20 -16
- package/dist/routes/feed/rss.js +34 -78
- package/dist/routes/feed/sitemap.js +11 -26
- package/dist/routes/pages/archive.js +18 -195
- package/dist/routes/pages/collection.js +16 -70
- package/dist/routes/pages/home.js +25 -47
- package/dist/routes/pages/page.js +15 -27
- package/dist/routes/pages/post.js +25 -79
- package/dist/routes/pages/search.js +20 -130
- package/dist/theme/components/MediaGallery.js +10 -10
- package/dist/theme/components/index.js +1 -1
- package/dist/theme/components/timeline/ArticleCard.js +7 -11
- package/dist/theme/components/timeline/ImageCard.js +10 -13
- package/dist/theme/components/timeline/LinkCard.js +4 -7
- package/dist/theme/components/timeline/NoteCard.js +5 -8
- package/dist/theme/components/timeline/QuoteCard.js +3 -6
- package/dist/theme/components/timeline/ThreadPreview.js +9 -10
- package/dist/theme/components/timeline/TimelineFeed.js +8 -5
- package/dist/theme/components/timeline/TimelineItem.js +22 -2
- package/dist/theme/components/timeline/index.js +1 -1
- package/dist/theme/index.js +6 -3
- package/dist/theme/layouts/SiteLayout.js +10 -39
- package/dist/theme/pages/ArchivePage.js +157 -0
- package/dist/theme/pages/CollectionPage.js +63 -0
- package/dist/theme/pages/HomePage.js +26 -0
- package/dist/theme/pages/PostPage.js +48 -0
- package/dist/theme/pages/SearchPage.js +120 -0
- package/dist/theme/pages/SinglePage.js +23 -0
- package/dist/theme/pages/index.js +11 -0
- package/package.json +2 -1
- package/src/app.tsx +1 -1
- package/src/i18n/locales/en.po +31 -31
- package/src/i18n/locales/zh-Hans.po +31 -31
- package/src/i18n/locales/zh-Hant.po +31 -31
- package/src/index.ts +51 -2
- package/src/lib/__tests__/theme-components.test.ts +33 -14
- package/src/lib/__tests__/view.test.ts +375 -0
- package/src/lib/feed.ts +148 -0
- package/src/lib/navigation.ts +11 -11
- package/src/lib/render.tsx +67 -0
- package/src/lib/theme-components.ts +27 -35
- package/src/lib/view.ts +318 -0
- package/src/routes/api/__tests__/timeline.test.ts +3 -3
- package/src/routes/api/timeline.tsx +32 -25
- package/src/routes/feed/rss.ts +47 -94
- package/src/routes/feed/sitemap.ts +8 -30
- package/src/routes/pages/archive.tsx +24 -209
- package/src/routes/pages/collection.tsx +19 -75
- package/src/routes/pages/home.tsx +42 -76
- package/src/routes/pages/page.tsx +17 -28
- package/src/routes/pages/post.tsx +28 -86
- package/src/routes/pages/search.tsx +29 -151
- package/src/services/search.ts +2 -8
- package/src/theme/components/MediaGallery.tsx +12 -12
- package/src/theme/components/index.ts +1 -0
- package/src/theme/components/timeline/ArticleCard.tsx +7 -19
- package/src/theme/components/timeline/ImageCard.tsx +10 -20
- package/src/theme/components/timeline/LinkCard.tsx +4 -11
- package/src/theme/components/timeline/NoteCard.tsx +5 -12
- package/src/theme/components/timeline/QuoteCard.tsx +3 -10
- package/src/theme/components/timeline/ThreadPreview.tsx +5 -5
- package/src/theme/components/timeline/TimelineFeed.tsx +7 -3
- package/src/theme/components/timeline/TimelineItem.tsx +43 -4
- package/src/theme/components/timeline/index.ts +1 -1
- package/src/theme/index.ts +7 -3
- package/src/theme/layouts/SiteLayout.tsx +25 -77
- package/src/theme/layouts/index.ts +2 -1
- package/src/theme/pages/ArchivePage.tsx +160 -0
- package/src/theme/pages/CollectionPage.tsx +60 -0
- package/src/theme/pages/HomePage.tsx +42 -0
- package/src/theme/pages/PostPage.tsx +44 -0
- package/src/theme/pages/SearchPage.tsx +128 -0
- package/src/theme/pages/SinglePage.tsx +24 -0
- package/src/theme/pages/index.ts +13 -0
- package/src/types.ts +262 -38
|
@@ -14,9 +14,9 @@ msgstr ""
|
|
|
14
14
|
"Plural-Forms: \n"
|
|
15
15
|
|
|
16
16
|
#. @context: Archive post reply indicator - plural
|
|
17
|
-
#: src/
|
|
18
|
-
msgid "{count} replies"
|
|
19
|
-
msgstr "{count} 條回覆"
|
|
17
|
+
#: src/theme/pages/ArchivePage.tsx:168
|
|
18
|
+
#~ msgid "{count} replies"
|
|
19
|
+
#~ msgstr "{count} 條回覆"
|
|
20
20
|
|
|
21
21
|
#. @context: Navigation link
|
|
22
22
|
#: src/routes/dash/collections.tsx:282
|
|
@@ -24,9 +24,9 @@ msgid "← Back to Collections"
|
|
|
24
24
|
msgstr "← 返回收藏夾"
|
|
25
25
|
|
|
26
26
|
#. @context: Archive post reply indicator - single
|
|
27
|
-
#: src/
|
|
28
|
-
msgid "1 reply"
|
|
29
|
-
msgstr "1 條回覆"
|
|
27
|
+
#: src/theme/pages/ArchivePage.tsx:163
|
|
28
|
+
#~ msgid "1 reply"
|
|
29
|
+
#~ msgstr "1 條回覆"
|
|
30
30
|
|
|
31
31
|
#. @context: Redirect type option
|
|
32
32
|
#: src/routes/dash/redirects.tsx:146
|
|
@@ -49,7 +49,7 @@ msgid "Add Media"
|
|
|
49
49
|
msgstr "添加媒體"
|
|
50
50
|
|
|
51
51
|
#. @context: Archive filter - all types
|
|
52
|
-
#: src/
|
|
52
|
+
#: src/theme/pages/ArchivePage.tsx:92
|
|
53
53
|
msgid "All"
|
|
54
54
|
msgstr "所有"
|
|
55
55
|
|
|
@@ -59,7 +59,7 @@ msgid "Appearance"
|
|
|
59
59
|
msgstr "外觀"
|
|
60
60
|
|
|
61
61
|
#. @context: Archive page title
|
|
62
|
-
#: src/
|
|
62
|
+
#: src/theme/pages/ArchivePage.tsx:77
|
|
63
63
|
msgid "Archive"
|
|
64
64
|
msgstr "檔案館"
|
|
65
65
|
|
|
@@ -71,14 +71,14 @@ msgstr ""
|
|
|
71
71
|
#. @context: Post type badge - article
|
|
72
72
|
#. @context: Post type label - article
|
|
73
73
|
#. @context: Post type option
|
|
74
|
-
#: src/routes/pages/archive.tsx:28
|
|
75
74
|
#: src/theme/components/PostForm.tsx:74
|
|
76
75
|
#: src/theme/components/TypeBadge.tsx:20
|
|
76
|
+
#: src/theme/pages/ArchivePage.tsx:18
|
|
77
77
|
msgid "Article"
|
|
78
78
|
msgstr "文章"
|
|
79
79
|
|
|
80
80
|
#. @context: Post type label plural - articles
|
|
81
|
-
#: src/
|
|
81
|
+
#: src/theme/pages/ArchivePage.tsx:43
|
|
82
82
|
msgid "Articles"
|
|
83
83
|
msgstr "文章"
|
|
84
84
|
|
|
@@ -351,12 +351,12 @@ msgid "Featured"
|
|
|
351
351
|
msgstr "精選"
|
|
352
352
|
|
|
353
353
|
#. @context: Search results count - multiple
|
|
354
|
-
#: src/
|
|
354
|
+
#: src/theme/pages/SearchPage.tsx:77
|
|
355
355
|
msgid "Found {count} results"
|
|
356
356
|
msgstr "找到 {count} 個結果"
|
|
357
357
|
|
|
358
358
|
#. @context: Search results count - single
|
|
359
|
-
#: src/
|
|
359
|
+
#: src/theme/pages/SearchPage.tsx:73
|
|
360
360
|
msgid "Found 1 result"
|
|
361
361
|
msgstr "找到 1 個結果"
|
|
362
362
|
|
|
@@ -375,14 +375,14 @@ msgstr "一般設定"
|
|
|
375
375
|
#. @context: Post type badge - image
|
|
376
376
|
#. @context: Post type label - image
|
|
377
377
|
#. @context: Post type option
|
|
378
|
-
#: src/routes/pages/archive.tsx:37
|
|
379
378
|
#: src/theme/components/PostForm.tsx:83
|
|
380
379
|
#: src/theme/components/TypeBadge.tsx:29
|
|
380
|
+
#: src/theme/pages/ArchivePage.tsx:27
|
|
381
381
|
msgid "Image"
|
|
382
382
|
msgstr "圖片"
|
|
383
383
|
|
|
384
384
|
#. @context: Post type label plural - images
|
|
385
|
-
#: src/
|
|
385
|
+
#: src/theme/pages/ArchivePage.tsx:55
|
|
386
386
|
msgid "Images"
|
|
387
387
|
msgstr "圖片"
|
|
388
388
|
|
|
@@ -409,21 +409,21 @@ msgstr "語言"
|
|
|
409
409
|
#. @context: Post type badge - link
|
|
410
410
|
#. @context: Post type label - link
|
|
411
411
|
#. @context: Post type option
|
|
412
|
-
#: src/routes/pages/archive.tsx:32
|
|
413
412
|
#: src/theme/components/PostForm.tsx:77
|
|
414
413
|
#: src/theme/components/TypeBadge.tsx:24
|
|
414
|
+
#: src/theme/pages/ArchivePage.tsx:22
|
|
415
415
|
msgid "Link"
|
|
416
416
|
msgstr "連結"
|
|
417
417
|
|
|
418
418
|
#. @context: Post type label plural - links
|
|
419
|
-
#: src/
|
|
419
|
+
#: src/theme/pages/ArchivePage.tsx:47
|
|
420
420
|
msgid "Links"
|
|
421
421
|
msgstr "連結"
|
|
422
422
|
|
|
423
423
|
#. @context: Button to load more posts in timeline
|
|
424
424
|
#. @context: Pagination button - load more items
|
|
425
425
|
#: src/theme/components/Pagination.tsx:103
|
|
426
|
-
#: src/theme/components/timeline/TimelineFeed.tsx:
|
|
426
|
+
#: src/theme/components/timeline/TimelineFeed.tsx:47
|
|
427
427
|
msgid "Load more"
|
|
428
428
|
msgstr "載入更多"
|
|
429
429
|
|
|
@@ -551,21 +551,21 @@ msgid "No pages yet."
|
|
|
551
551
|
msgstr "尚未有頁面。"
|
|
552
552
|
|
|
553
553
|
#. @context: Archive empty state
|
|
554
|
-
#: src/
|
|
554
|
+
#: src/theme/pages/ArchivePage.tsx:112
|
|
555
555
|
msgid "No posts found."
|
|
556
556
|
msgstr "未找到任何帖子。"
|
|
557
557
|
|
|
558
558
|
#. @context: Empty state message
|
|
559
559
|
#. @context: Empty state message
|
|
560
560
|
#: src/routes/dash/collections.tsx:243
|
|
561
|
-
#: src/
|
|
561
|
+
#: src/theme/pages/CollectionPage.tsx:30
|
|
562
562
|
msgid "No posts in this collection."
|
|
563
563
|
msgstr "此集合中沒有帖子。"
|
|
564
564
|
|
|
565
565
|
#. @context: Empty state message on home page
|
|
566
566
|
#. @context: Empty state message when no posts exist
|
|
567
|
-
#: src/routes/pages/home.tsx:42
|
|
568
567
|
#: src/theme/components/PostList.tsx:25
|
|
568
|
+
#: src/theme/pages/HomePage.tsx:27
|
|
569
569
|
msgid "No posts yet."
|
|
570
570
|
msgstr "尚未有帖子。"
|
|
571
571
|
|
|
@@ -575,21 +575,21 @@ msgid "No redirects configured."
|
|
|
575
575
|
msgstr "未配置任何重定向。"
|
|
576
576
|
|
|
577
577
|
#. @context: Search empty results
|
|
578
|
-
#: src/
|
|
578
|
+
#: src/theme/pages/SearchPage.tsx:68
|
|
579
579
|
msgid "No results found."
|
|
580
580
|
msgstr "未找到結果。"
|
|
581
581
|
|
|
582
582
|
#. @context: Post type badge - note
|
|
583
583
|
#. @context: Post type label - note
|
|
584
584
|
#. @context: Post type option
|
|
585
|
-
#: src/routes/pages/archive.tsx:27
|
|
586
585
|
#: src/theme/components/PostForm.tsx:71
|
|
587
586
|
#: src/theme/components/TypeBadge.tsx:19
|
|
587
|
+
#: src/theme/pages/ArchivePage.tsx:17
|
|
588
588
|
msgid "Note"
|
|
589
589
|
msgstr "備註"
|
|
590
590
|
|
|
591
591
|
#. @context: Post type label plural - notes
|
|
592
|
-
#: src/
|
|
592
|
+
#: src/theme/pages/ArchivePage.tsx:39
|
|
593
593
|
msgid "Notes"
|
|
594
594
|
msgstr "筆記"
|
|
595
595
|
|
|
@@ -597,8 +597,8 @@ msgstr "筆記"
|
|
|
597
597
|
#. @context: Post type badge - page
|
|
598
598
|
#. @context: Post type label - page
|
|
599
599
|
#: src/routes/dash/pages.tsx:125
|
|
600
|
-
#: src/routes/pages/archive.tsx:41
|
|
601
600
|
#: src/theme/components/TypeBadge.tsx:33
|
|
601
|
+
#: src/theme/pages/ArchivePage.tsx:31
|
|
602
602
|
msgid "Page"
|
|
603
603
|
msgstr "頁面"
|
|
604
604
|
|
|
@@ -621,8 +621,8 @@ msgstr "頁面標題..."
|
|
|
621
621
|
#. @context: Pages main heading
|
|
622
622
|
#. @context: Post type label plural - pages
|
|
623
623
|
#: src/routes/dash/pages.tsx:36
|
|
624
|
-
#: src/routes/pages/archive.tsx:69
|
|
625
624
|
#: src/theme/layouts/DashLayout.tsx:96
|
|
625
|
+
#: src/theme/pages/ArchivePage.tsx:59
|
|
626
626
|
msgid "Pages"
|
|
627
627
|
msgstr "頁面"
|
|
628
628
|
|
|
@@ -645,8 +645,8 @@ msgstr "路徑(例如 /archive)或完整網址(例如 https://example.com
|
|
|
645
645
|
|
|
646
646
|
#. @context: Link to individual post in thread
|
|
647
647
|
#. @context: Link to permanent URL of post
|
|
648
|
-
#: src/routes/pages/post.tsx:56
|
|
649
648
|
#: src/theme/components/ThreadView.tsx:68
|
|
649
|
+
#: src/theme/pages/PostPage.tsx:36
|
|
650
650
|
msgid "Permalink"
|
|
651
651
|
msgstr "永久鏈接"
|
|
652
652
|
|
|
@@ -753,14 +753,14 @@ msgstr "安靜(正常)"
|
|
|
753
753
|
#. @context: Post type badge - quote
|
|
754
754
|
#. @context: Post type label - quote
|
|
755
755
|
#. @context: Post type option
|
|
756
|
-
#: src/routes/pages/archive.tsx:33
|
|
757
756
|
#: src/theme/components/PostForm.tsx:80
|
|
758
757
|
#: src/theme/components/TypeBadge.tsx:25
|
|
758
|
+
#: src/theme/pages/ArchivePage.tsx:23
|
|
759
759
|
msgid "Quote"
|
|
760
760
|
msgstr "引用"
|
|
761
761
|
|
|
762
762
|
#. @context: Post type label plural - quotes
|
|
763
|
-
#: src/
|
|
763
|
+
#: src/theme/pages/ArchivePage.tsx:51
|
|
764
764
|
msgid "Quotes"
|
|
765
765
|
msgstr "引用"
|
|
766
766
|
|
|
@@ -802,13 +802,13 @@ msgstr "保存設定"
|
|
|
802
802
|
|
|
803
803
|
#. @context: Search page title
|
|
804
804
|
#. @context: Search submit button
|
|
805
|
-
#: src/
|
|
806
|
-
#: src/
|
|
805
|
+
#: src/theme/pages/SearchPage.tsx:22
|
|
806
|
+
#: src/theme/pages/SearchPage.tsx:48
|
|
807
807
|
msgid "Search"
|
|
808
808
|
msgstr "搜尋"
|
|
809
809
|
|
|
810
810
|
#. @context: Search input placeholder
|
|
811
|
-
#: src/
|
|
811
|
+
#: src/theme/pages/SearchPage.tsx:40
|
|
812
812
|
msgid "Search posts..."
|
|
813
813
|
msgstr "搜尋帖子..."
|
|
814
814
|
|
package/src/index.ts
CHANGED
|
@@ -10,7 +10,7 @@ import { createApp as _createApp } from "./app.js";
|
|
|
10
10
|
export { createApp } from "./app.js";
|
|
11
11
|
export type { App, AppVariables } from "./app.js";
|
|
12
12
|
|
|
13
|
-
// Types
|
|
13
|
+
// Types
|
|
14
14
|
export type {
|
|
15
15
|
PostType,
|
|
16
16
|
Visibility,
|
|
@@ -29,10 +29,31 @@ export type {
|
|
|
29
29
|
JantConfig,
|
|
30
30
|
JantTheme,
|
|
31
31
|
ThemeComponents,
|
|
32
|
+
// View Model types (for theme authors)
|
|
33
|
+
PostView,
|
|
34
|
+
MediaView,
|
|
35
|
+
NavLinkView,
|
|
36
|
+
SearchResultView,
|
|
37
|
+
TimelineItemView,
|
|
38
|
+
ArchiveGroup,
|
|
39
|
+
// Timeline types
|
|
32
40
|
TimelineCardProps,
|
|
33
41
|
ThreadPreviewProps,
|
|
34
|
-
TimelineItemData,
|
|
35
42
|
TimelineFeedProps,
|
|
43
|
+
// Site layout
|
|
44
|
+
SiteLayoutProps,
|
|
45
|
+
// Page-level props (for theme authors)
|
|
46
|
+
HomePageProps,
|
|
47
|
+
PostPageProps,
|
|
48
|
+
SinglePageProps,
|
|
49
|
+
ArchivePageProps,
|
|
50
|
+
SearchPageProps,
|
|
51
|
+
CollectionPageProps,
|
|
52
|
+
// Feed types (for theme authors)
|
|
53
|
+
FeedData,
|
|
54
|
+
SitemapData,
|
|
55
|
+
// Search
|
|
56
|
+
SearchResult,
|
|
36
57
|
} from "./types.js";
|
|
37
58
|
|
|
38
59
|
export {
|
|
@@ -48,5 +69,33 @@ export * as sqid from "./lib/sqid.js";
|
|
|
48
69
|
export * as url from "./lib/url.js";
|
|
49
70
|
export * as markdown from "./lib/markdown.js";
|
|
50
71
|
|
|
72
|
+
// View Model conversion utilities (for advanced theme use)
|
|
73
|
+
export {
|
|
74
|
+
createMediaContext,
|
|
75
|
+
toPostView,
|
|
76
|
+
toPostViews,
|
|
77
|
+
toMediaView,
|
|
78
|
+
toNavLinkView,
|
|
79
|
+
toNavLinkViews,
|
|
80
|
+
toSearchResultView,
|
|
81
|
+
toArchiveGroups,
|
|
82
|
+
} from "./lib/view.js";
|
|
83
|
+
export type { MediaContext } from "./lib/view.js";
|
|
84
|
+
|
|
85
|
+
// Render helper (for theme authors adding custom routes)
|
|
86
|
+
export { renderPublicPage } from "./lib/render.js";
|
|
87
|
+
export type { RenderPublicPageOptions } from "./lib/render.js";
|
|
88
|
+
|
|
89
|
+
// Navigation helper (for theme authors)
|
|
90
|
+
export { getNavigationData } from "./lib/navigation.js";
|
|
91
|
+
export type { NavigationData } from "./lib/navigation.js";
|
|
92
|
+
|
|
93
|
+
// Default feed renderers (for theme authors to extend)
|
|
94
|
+
export {
|
|
95
|
+
defaultRssRenderer,
|
|
96
|
+
defaultAtomRenderer,
|
|
97
|
+
defaultSitemapRenderer,
|
|
98
|
+
} from "./lib/feed.js";
|
|
99
|
+
|
|
51
100
|
// Default export for running core directly (e.g., for development)
|
|
52
101
|
export default _createApp();
|
|
@@ -1,15 +1,12 @@
|
|
|
1
1
|
import { describe, it, expect } from "vitest";
|
|
2
|
-
import {
|
|
3
|
-
resolveCardComponent,
|
|
4
|
-
resolveThreadPreview,
|
|
5
|
-
resolveTimelineFeed,
|
|
6
|
-
} from "../theme-components.js";
|
|
2
|
+
import { resolveCardComponent, resolveComponent } from "../theme-components.js";
|
|
7
3
|
import type {
|
|
8
4
|
ThemeComponents,
|
|
9
5
|
TimelineCardProps,
|
|
10
6
|
ThreadPreviewProps,
|
|
11
7
|
TimelineFeedProps,
|
|
12
8
|
PostType,
|
|
9
|
+
HomePageProps,
|
|
13
10
|
} from "../../types.js";
|
|
14
11
|
import type { FC } from "hono/jsx";
|
|
15
12
|
|
|
@@ -21,6 +18,7 @@ const MockQuoteCard: FC<TimelineCardProps> = () => null;
|
|
|
21
18
|
const MockImageCard: FC<TimelineCardProps> = () => null;
|
|
22
19
|
const MockThreadPreview: FC<ThreadPreviewProps> = () => null;
|
|
23
20
|
const MockTimelineFeed: FC<TimelineFeedProps> = () => null;
|
|
21
|
+
const MockHomePage: FC<HomePageProps> = () => null;
|
|
24
22
|
|
|
25
23
|
const DEFAULT_CARD_MAP: Record<PostType, FC<TimelineCardProps>> = {
|
|
26
24
|
note: MockNoteCard,
|
|
@@ -79,29 +77,50 @@ describe("theme-components", () => {
|
|
|
79
77
|
});
|
|
80
78
|
});
|
|
81
79
|
|
|
82
|
-
describe("
|
|
80
|
+
describe("resolveComponent", () => {
|
|
83
81
|
it("returns default ThreadPreview when no override", () => {
|
|
84
|
-
expect(
|
|
82
|
+
expect(resolveComponent("ThreadPreview", MockThreadPreview)).toBe(
|
|
83
|
+
MockThreadPreview,
|
|
84
|
+
);
|
|
85
85
|
});
|
|
86
86
|
|
|
87
|
-
it("returns theme override when provided", () => {
|
|
87
|
+
it("returns theme override for ThreadPreview when provided", () => {
|
|
88
88
|
const Custom: FC<ThreadPreviewProps> = () => null;
|
|
89
89
|
expect(
|
|
90
|
-
|
|
90
|
+
resolveComponent("ThreadPreview", MockThreadPreview, {
|
|
91
|
+
ThreadPreview: Custom,
|
|
92
|
+
}),
|
|
91
93
|
).toBe(Custom);
|
|
92
94
|
});
|
|
93
|
-
});
|
|
94
95
|
|
|
95
|
-
describe("resolveTimelineFeed", () => {
|
|
96
96
|
it("returns default TimelineFeed when no override", () => {
|
|
97
|
-
expect(
|
|
97
|
+
expect(resolveComponent("TimelineFeed", MockTimelineFeed)).toBe(
|
|
98
|
+
MockTimelineFeed,
|
|
99
|
+
);
|
|
98
100
|
});
|
|
99
101
|
|
|
100
|
-
it("returns theme override when provided", () => {
|
|
102
|
+
it("returns theme override for TimelineFeed when provided", () => {
|
|
101
103
|
const Custom: FC<TimelineFeedProps> = () => null;
|
|
102
104
|
expect(
|
|
103
|
-
|
|
105
|
+
resolveComponent("TimelineFeed", MockTimelineFeed, {
|
|
106
|
+
TimelineFeed: Custom,
|
|
107
|
+
}),
|
|
104
108
|
).toBe(Custom);
|
|
105
109
|
});
|
|
110
|
+
|
|
111
|
+
it("returns default HomePage when no override", () => {
|
|
112
|
+
expect(resolveComponent("HomePage", MockHomePage)).toBe(MockHomePage);
|
|
113
|
+
});
|
|
114
|
+
|
|
115
|
+
it("returns theme override for HomePage when provided", () => {
|
|
116
|
+
const Custom: FC<HomePageProps> = () => null;
|
|
117
|
+
expect(
|
|
118
|
+
resolveComponent("HomePage", MockHomePage, { HomePage: Custom }),
|
|
119
|
+
).toBe(Custom);
|
|
120
|
+
});
|
|
121
|
+
|
|
122
|
+
it("returns default when theme has empty overrides", () => {
|
|
123
|
+
expect(resolveComponent("HomePage", MockHomePage, {})).toBe(MockHomePage);
|
|
124
|
+
});
|
|
106
125
|
});
|
|
107
126
|
});
|