mirror of
https://github.com/wu736139669/hapi.git
synced 2026-11-25 05:07:05 +00:00
* fix(web): trust live hub connectivity over navigator status * fix(web): align offline and reconnecting banner precedence * test(web): provide i18n context to banner tests
19 lines
711 B
TypeScript
19 lines
711 B
TypeScript
import { render, screen } from '@testing-library/react'
|
|
import { describe, expect, it } from 'vitest'
|
|
import { I18nProvider } from '@/lib/i18n-context'
|
|
import { ReconnectingBanner } from './ReconnectingBanner'
|
|
|
|
describe('ReconnectingBanner', () => {
|
|
it('shows whenever the hub SSE connection is reconnecting', () => {
|
|
render(<I18nProvider><ReconnectingBanner isReconnecting reason="error" /></I18nProvider>)
|
|
|
|
expect(screen.getByText(/reconnecting/i)).toBeInTheDocument()
|
|
})
|
|
|
|
it('stays hidden while connected', () => {
|
|
render(<I18nProvider><ReconnectingBanner isReconnecting={false} /></I18nProvider>)
|
|
|
|
expect(screen.queryByText(/reconnecting/i)).toBeNull()
|
|
})
|
|
})
|