Skip to content

Commit 4f78b3c

Browse files
committed
fix: unit tests
1 parent 993cdbf commit 4f78b3c

2 files changed

Lines changed: 64 additions & 1 deletion

File tree

components/_utils/use-theme.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,7 +49,7 @@ function setThemeMode(next: ThemeMode): void {
4949
}
5050

5151
// Listen for system preference changes at module level
52-
if (typeof window !== 'undefined') {
52+
if (typeof window !== 'undefined' && typeof window.matchMedia === 'function') {
5353
window
5454
.matchMedia('(prefers-color-scheme: dark)')
5555
.addEventListener('change', () => {

components/table/__tests__/__snapshots__/table.test.tsx.snap

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,69 @@ exports[`<Table /> should match the snapshot 1`] = `
9797
</tbody>
9898
</table>
9999
</div>
100+
<nav
101+
aria-label="Pagination"
102+
class="ty-pagination ty-pagination_right ty-pagination_md"
103+
style="padding: 16px 0px;"
104+
>
105+
<ul
106+
class="ty-pagination__list"
107+
>
108+
<li
109+
class="ty-pagination__item ty-pagination__item_disabled"
110+
>
111+
<button
112+
aria-label="Previous page"
113+
disabled=""
114+
type="button"
115+
>
116+
<svg
117+
class="ty-pagination__left-arrow"
118+
height="12"
119+
viewBox="0 0 1024 1024"
120+
width="12"
121+
>
122+
<path
123+
d="M472.064 751.552 72.832 352.32c-22.08-22.08-22.08-57.792 0-79.872 22.016-22.016 57.792-22.08 79.872 0L512 631.744l359.296-359.296c22.016-22.016 57.792-22.08 79.872 0 22.08 22.08 22.016 57.792 0 79.872l-399.232 399.232C529.856 773.568 494.144 773.568 472.064 751.552z"
124+
fill="currentcolor"
125+
/>
126+
</svg>
127+
</button>
128+
</li>
129+
<li
130+
class="ty-pagination__item ty-pagination__item_active"
131+
>
132+
<button
133+
aria-current="page"
134+
aria-label="Page 1"
135+
type="button"
136+
>
137+
1
138+
</button>
139+
</li>
140+
<li
141+
class="ty-pagination__item ty-pagination__item_disabled"
142+
>
143+
<button
144+
aria-label="Next page"
145+
disabled=""
146+
type="button"
147+
>
148+
<svg
149+
class="ty-pagination__right-arrow"
150+
height="12"
151+
viewBox="0 0 1024 1024"
152+
width="12"
153+
>
154+
<path
155+
d="M472.064 751.552 72.832 352.32c-22.08-22.08-22.08-57.792 0-79.872 22.016-22.016 57.792-22.08 79.872 0L512 631.744l359.296-359.296c22.016-22.016 57.792-22.08 79.872 0 22.08 22.08 22.016 57.792 0 79.872l-399.232 399.232C529.856 773.568 494.144 773.568 472.064 751.552z"
156+
fill="currentcolor"
157+
/>
158+
</svg>
159+
</button>
160+
</li>
161+
</ul>
162+
</nav>
100163
</div>
101164
</DocumentFragment>
102165
`;

0 commit comments

Comments
 (0)