test: add unit tests for Uptime page and setup API

This commit is contained in:
GitHub Actions
2025-11-30 15:39:21 +00:00
parent 224a53975d
commit 92697ec5ec
4 changed files with 214 additions and 0 deletions
+16
View File
@@ -0,0 +1,16 @@
import { describe, it, expect } from 'vitest'
describe('Test setup file checks', () => {
it('sets the React act environment flag', () => {
expect(globalThis.IS_REACT_ACT_ENVIRONMENT).toBe(true)
})
it('stubs window.matchMedia with expected interface', () => {
const mq = window.matchMedia('(min-width: 100px)')
expect(mq.matches).toBe(false)
expect(typeof mq.addListener).toBe('function')
expect(typeof mq.removeListener).toBe('function')
expect(typeof mq.addEventListener).toBe('function')
expect(typeof mq.removeEventListener).toBe('function')
})
})