Skip to content

Commit 2d1b273

Browse files
committed
refactor: update snapshot tests for listbase and listfilter
1 parent a4fde5e commit 2d1b273

File tree

3 files changed

+177
-54
lines changed

3 files changed

+177
-54
lines changed

.github/workflows/frontend.yml

+3
Original file line numberDiff line numberDiff line change
@@ -25,5 +25,8 @@ jobs:
2525
- name: Install dependencies
2626
run: npm ci
2727

28+
- name: Run tests
29+
run: npm run test
30+
2831
- name: Build project (prod)
2932
run: npx webpack

vis/test/snapshot/__snapshots__/list-base.test.jsx.snap

+116-36
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,40 @@ exports[`List entries component snapshot (BASE) > matches a snapshot (zoomed-in,
111111
role="button"
112112
type="button"
113113
>
114-
show:
115114
<span
116-
id="curr-filter-type"
117-
>
118-
Any
119-
</span>
120-
<i
121-
className="fas fa-chevron-down chevron"
122115
style={
123116
{
124-
"marginLeft": "3px",
117+
"alignItems": "center",
118+
"display": "flex",
119+
"justifyContent": "center",
120+
"maxWidth": "100%",
125121
}
126122
}
127-
/>
123+
>
124+
<span>
125+
show:
126+
</span>
127+
<span
128+
className="truncate-text"
129+
id="curr-filter-type"
130+
style={
131+
{
132+
"marginLeft": "3px",
133+
"minWidth": "0px",
134+
}
135+
}
136+
>
137+
Any
138+
</span>
139+
<i
140+
className="fas fa-chevron-down chevron"
141+
style={
142+
{
143+
"marginLeft": "3px",
144+
}
145+
}
146+
/>
147+
</span>
128148
</button>
129149
<ul
130150
aria-labelledby="filter_params"
@@ -195,20 +215,40 @@ exports[`List entries component snapshot (BASE) > matches a snapshot (zoomed-in,
195215
role="button"
196216
type="button"
197217
>
198-
sort by:
199218
<span
200-
id="curr-sort-type"
201-
>
202-
Relevance
203-
</span>
204-
<i
205-
className="fas fa-chevron-down chevron"
206219
style={
207220
{
208-
"marginLeft": "3px",
221+
"alignItems": "center",
222+
"display": "flex",
223+
"justifyContent": "center",
224+
"maxWidth": "100%",
209225
}
210226
}
211-
/>
227+
>
228+
<span>
229+
sort by:
230+
</span>
231+
<span
232+
className="truncate-text"
233+
id="curr-filter-type"
234+
style={
235+
{
236+
"marginLeft": "3px",
237+
"minWidth": "0px",
238+
}
239+
}
240+
>
241+
Relevance
242+
</span>
243+
<i
244+
className="fas fa-chevron-down chevron"
245+
style={
246+
{
247+
"marginLeft": "3px",
248+
}
249+
}
250+
/>
251+
</span>
212252
</button>
213253
<ul
214254
aria-labelledby="sort"
@@ -636,20 +676,40 @@ exports[`List entries component snapshot (BASE) > matches a snapshot (zoomed-out
636676
role="button"
637677
type="button"
638678
>
639-
show:
640679
<span
641-
id="curr-filter-type"
642-
>
643-
Any
644-
</span>
645-
<i
646-
className="fas fa-chevron-down chevron"
647680
style={
648681
{
649-
"marginLeft": "3px",
682+
"alignItems": "center",
683+
"display": "flex",
684+
"justifyContent": "center",
685+
"maxWidth": "100%",
650686
}
651687
}
652-
/>
688+
>
689+
<span>
690+
show:
691+
</span>
692+
<span
693+
className="truncate-text"
694+
id="curr-filter-type"
695+
style={
696+
{
697+
"marginLeft": "3px",
698+
"minWidth": "0px",
699+
}
700+
}
701+
>
702+
Any
703+
</span>
704+
<i
705+
className="fas fa-chevron-down chevron"
706+
style={
707+
{
708+
"marginLeft": "3px",
709+
}
710+
}
711+
/>
712+
</span>
653713
</button>
654714
<ul
655715
aria-labelledby="filter_params"
@@ -720,20 +780,40 @@ exports[`List entries component snapshot (BASE) > matches a snapshot (zoomed-out
720780
role="button"
721781
type="button"
722782
>
723-
sort by:
724783
<span
725-
id="curr-sort-type"
726-
>
727-
Relevance
728-
</span>
729-
<i
730-
className="fas fa-chevron-down chevron"
731784
style={
732785
{
733-
"marginLeft": "3px",
786+
"alignItems": "center",
787+
"display": "flex",
788+
"justifyContent": "center",
789+
"maxWidth": "100%",
734790
}
735791
}
736-
/>
792+
>
793+
<span>
794+
sort by:
795+
</span>
796+
<span
797+
className="truncate-text"
798+
id="curr-filter-type"
799+
style={
800+
{
801+
"marginLeft": "3px",
802+
"minWidth": "0px",
803+
}
804+
}
805+
>
806+
Relevance
807+
</span>
808+
<i
809+
className="fas fa-chevron-down chevron"
810+
style={
811+
{
812+
"marginLeft": "3px",
813+
}
814+
}
815+
/>
816+
</span>
737817
</button>
738818
<ul
739819
aria-labelledby="sort"

vis/test/snapshot/__snapshots__/listfilter.test.jsx.snap

+58-18
Original file line numberDiff line numberDiff line change
@@ -52,20 +52,40 @@ exports[`List filter component snapshot > matches a snapshot 1`] = `
5252
role="button"
5353
type="button"
5454
>
55-
Filter by:
5655
<span
57-
id="curr-filter-type"
58-
>
59-
All
60-
</span>
61-
<i
62-
className="fas fa-chevron-down chevron"
6356
style={
6457
{
65-
"marginLeft": "3px",
58+
"alignItems": "center",
59+
"display": "flex",
60+
"justifyContent": "center",
61+
"maxWidth": "100%",
6662
}
6763
}
68-
/>
64+
>
65+
<span>
66+
Filter by:
67+
</span>
68+
<span
69+
className="truncate-text"
70+
id="curr-filter-type"
71+
style={
72+
{
73+
"marginLeft": "3px",
74+
"minWidth": "0px",
75+
}
76+
}
77+
>
78+
All
79+
</span>
80+
<i
81+
className="fas fa-chevron-down chevron"
82+
style={
83+
{
84+
"marginLeft": "3px",
85+
}
86+
}
87+
/>
88+
</span>
6989
</button>
7090
<ul
7191
aria-labelledby="filter_params"
@@ -136,20 +156,40 @@ exports[`List filter component snapshot > matches a snapshot 1`] = `
136156
role="button"
137157
type="button"
138158
>
139-
Sort by:
140159
<span
141-
id="curr-sort-type"
142-
>
143-
Relevance
144-
</span>
145-
<i
146-
className="fas fa-chevron-down chevron"
147160
style={
148161
{
149-
"marginLeft": "3px",
162+
"alignItems": "center",
163+
"display": "flex",
164+
"justifyContent": "center",
165+
"maxWidth": "100%",
150166
}
151167
}
152-
/>
168+
>
169+
<span>
170+
Sort by:
171+
</span>
172+
<span
173+
className="truncate-text"
174+
id="curr-filter-type"
175+
style={
176+
{
177+
"marginLeft": "3px",
178+
"minWidth": "0px",
179+
}
180+
}
181+
>
182+
Relevance
183+
</span>
184+
<i
185+
className="fas fa-chevron-down chevron"
186+
style={
187+
{
188+
"marginLeft": "3px",
189+
}
190+
}
191+
/>
192+
</span>
153193
</button>
154194
<ul
155195
aria-labelledby="sort"

0 commit comments

Comments
 (0)