We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
window.matchMedia
1 parent dcfafd2 commit 3d6d644Copy full SHA for 3d6d644
test/test.js
@@ -79,6 +79,21 @@ describe('typing-effect', function () {
79
})
80
81
describe('a11y considerations', function () {
82
+ let realMatchMedia
83
+ before(() => {
84
+ realMatchMedia = window.matchMedia
85
+ window.matchMedia = mediaString => {
86
+ if (mediaString === '(prefers-reduced-motion)') {
87
+ return {matches: true}
88
+ }
89
+ return realMatchMedia(mediaString)
90
91
+ })
92
+
93
+ after(() => {
94
+ window.matchMedia = realMatchMedia
95
96
97
it('sets delay to 0 when media query matches (prefers-reduced-motion)', function () {
98
const typingEffectElement = document.createElement('typing-effect')
99
document.body.append(typingEffectElement)
0 commit comments