Skip to content

Commit 229d716

Browse files
committed
test: add test for collections page
1 parent d1ee445 commit 229d716

File tree

5 files changed

+577
-2
lines changed

5 files changed

+577
-2
lines changed
Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
{
2+
"comment": "This mock is captured from a real search result and roughly edited to match the mocks in src/library-authoring/data/api.mocks.ts",
3+
"note": "The _formatted fields have been removed from this result and should be re-added programatically when mocking.",
4+
"results": [
5+
{
6+
"indexUid": "studio_content",
7+
"hits": [
8+
{
9+
"id": "lbaximtesthtml571fe018-f3ce-45c9-8f53-5dafcb422fdd-273ebd90",
10+
"display_name": "Introduction to Testing",
11+
"block_id": "571fe018-f3ce-45c9-8f53-5dafcb422fdd",
12+
"content": {
13+
"html_content": "This is a text component which uses HTML."
14+
},
15+
"tags": {},
16+
"type": "library_block",
17+
"breadcrumbs": [
18+
{
19+
"display_name": "Test Library"
20+
}
21+
],
22+
"created": 1721857069.042984,
23+
"modified": 1725878053.420395,
24+
"last_published": 1725035862.450613,
25+
"usage_key": "lb:Axim:TEST:html:571fe018-f3ce-45c9-8f53-5dafcb422fdd",
26+
"block_type": "html",
27+
"context_key": "lib:Axim:TEST",
28+
"org": "Axim",
29+
"access_id": 15,
30+
"collections": {
31+
"display_name": [
32+
"My first collection"
33+
],
34+
"key": [
35+
"my-first-collection"
36+
]
37+
}
38+
},
39+
{
40+
"id": "lbaximtesthtml73a22298-bcd9-4f4c-ae34-0bc2b0612480-46b4a7f2",
41+
"display_name": "Second Text Component",
42+
"block_id": "73a22298-bcd9-4f4c-ae34-0bc2b0612480",
43+
"content": {
44+
"html_content": "Preview of the second text component here"
45+
},
46+
"type": "library_block",
47+
"breadcrumbs": [
48+
{
49+
"display_name": "Test Library"
50+
}
51+
],
52+
"created": 1724879593.066427,
53+
"modified": 1725034981.663482,
54+
"last_published": 1725035862.450613,
55+
"usage_key": "lb:Axim:TEST:html:73a22298-bcd9-4f4c-ae34-0bc2b0612480",
56+
"block_type": "html",
57+
"context_key": "lib:Axim:TEST",
58+
"org": "Axim",
59+
"access_id": 15,
60+
"collections": {
61+
"display_name": [
62+
"My first collection"
63+
],
64+
"key": [
65+
"my-first-collection"
66+
]
67+
}
68+
},
69+
{
70+
"id": "lbaximtesthtmlbe5b5db9-26ba-4fac-86af-654538c70b5e-73dbaa95",
71+
"display_name": "Third Text component",
72+
"block_id": "be5b5db9-26ba-4fac-86af-654538c70b5e",
73+
"content": {
74+
"html_content": "This is a text component that I've edited within the library. "
75+
},
76+
"tags": {},
77+
"type": "library_block",
78+
"breadcrumbs": [
79+
{
80+
"display_name": "Test Library"
81+
}
82+
],
83+
"created": 1721857034.455737,
84+
"modified": 1722551300.377488,
85+
"last_published": 1724879092.002222,
86+
"usage_key": "lb:Axim:TEST:html:be5b5db9-26ba-4fac-86af-654538c70b5e",
87+
"block_type": "html",
88+
"context_key": "lib:Axim:TEST",
89+
"org": "Axim",
90+
"access_id": 15,
91+
"collections": {
92+
"display_name": [
93+
"My first collection",
94+
"My second collection"
95+
],
96+
"key": [
97+
"my-first-collection",
98+
"my-second-collection"
99+
]
100+
}
101+
},
102+
{
103+
"id": "lbaximtesthtmle59e8c73-4056-4894-bca4-062781fb3f68-46a404b2",
104+
"display_name": "Text 4",
105+
"block_id": "e59e8c73-4056-4894-bca4-062781fb3f68",
106+
"content": {
107+
"html_content": ""
108+
},
109+
"tags": {},
110+
"type": "library_block",
111+
"breadcrumbs": [
112+
{
113+
"display_name": "Test Library"
114+
}
115+
],
116+
"created": 1720774228.49832,
117+
"modified": 1720774228.49832,
118+
"last_published": 1724879092.002222,
119+
"usage_key": "lb:Axim:TEST:html:e59e8c73-4056-4894-bca4-062781fb3f68",
120+
"block_type": "html",
121+
"context_key": "lib:Axim:TEST",
122+
"org": "Axim",
123+
"access_id": 15,
124+
"collections": {
125+
"display_name": [
126+
"My first collection"
127+
],
128+
"key": [
129+
"my-first-collection"
130+
]
131+
}
132+
},
133+
{
134+
"id": "lbaximtestproblemf16116c9-516e-4bb9-b99e-103599f62417-f2798115",
135+
"display_name": "Blank Problem",
136+
"block_id": "f16116c9-516e-4bb9-b99e-103599f62417",
137+
"content": {
138+
"problem_types": [],
139+
"capa_content": " "
140+
},
141+
"type": "library_block",
142+
"breadcrumbs": [
143+
{
144+
"display_name": "Test Library"
145+
}
146+
],
147+
"created": 1724725821.973896,
148+
"modified": 1724725821.973896,
149+
"last_published": 1724879092.002222,
150+
"usage_key": "lb:Axim:TEST:problem:f16116c9-516e-4bb9-b99e-103599f62417",
151+
"block_type": "problem",
152+
"context_key": "lib:Axim:TEST",
153+
"org": "Axim",
154+
"access_id": 15,
155+
"collections": {
156+
"display_name": [
157+
"My first collection"
158+
],
159+
"key": [
160+
"my-first-collection"
161+
]
162+
}
163+
}
164+
],
165+
"query": "",
166+
"processingTimeMs": 1,
167+
"limit": 20,
168+
"offset": 0,
169+
"estimatedTotalHits": 5
170+
},
171+
{
172+
"indexUid": "studio_content",
173+
"hits": [],
174+
"query": "",
175+
"processingTimeMs": 0,
176+
"limit": 0,
177+
"offset": 0,
178+
"estimatedTotalHits": 5,
179+
"facetDistribution": {
180+
"block_type": {
181+
"html": 4,
182+
"problem": 1
183+
},
184+
"content.problem_types": {}
185+
},
186+
"facetStats": {}
187+
}
188+
]
189+
}

0 commit comments

Comments
 (0)