Initial public release
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
GeoIntel release gates / Compile, test, contracts and builds (push) Successful in 1m49s
GeoIntel release gates / Python and npm vulnerability policy (push) Successful in 21s
GeoIntel release gates / Production AI image, SBOM and container scan (push) Successful in 5m39s
GeoIntel release gates / Deploy exact gated revision to Unraid (push) Failing after 58m43s
This commit is contained in:
@@ -0,0 +1,41 @@
|
||||
import { cleanup, render, screen } from '@testing-library/react'
|
||||
import { afterEach, describe, expect, it, vi } from 'vitest'
|
||||
import { ProviderPanel } from './ProviderPanel'
|
||||
import type { ProviderCapability } from '../../types'
|
||||
|
||||
function props(overschrijf: Partial<Parameters<typeof ProviderPanel>[0]> = {}) {
|
||||
return {
|
||||
selectedProjectId: 'p-1',
|
||||
providers: [] as ProviderCapability[],
|
||||
loadingCapabilities: false,
|
||||
capabilitiesError: null,
|
||||
onRefresh: vi.fn(),
|
||||
onOpenSources: vi.fn(),
|
||||
onOpenStatus: vi.fn(),
|
||||
onOpenMap: vi.fn(),
|
||||
...overschrijf,
|
||||
}
|
||||
}
|
||||
|
||||
describe('ProviderPanel', () => {
|
||||
afterEach(() => cleanup())
|
||||
|
||||
it('blijft overeind bij een antwoord dat zijn eigen contract schendt', () => {
|
||||
// Het type zegt dat providers altijd meekomt. Dit paneel gebruikte die
|
||||
// lijst op drie plekken en had er op één een guard; nu wordt hij aan de
|
||||
// kop genormaliseerd. Een type is een belofte van de compiler, niet van
|
||||
// het netwerk.
|
||||
const zonder = props({ providers: undefined as unknown as ProviderCapability[] })
|
||||
expect(() => render(<ProviderPanel {...zonder} />)).not.toThrow()
|
||||
})
|
||||
|
||||
it('toont een lege toestand zonder koppelingen', () => {
|
||||
render(<ProviderPanel {...props()} />)
|
||||
expect(screen.getByText(/geen databronnen gemeld/i)).toBeTruthy()
|
||||
})
|
||||
|
||||
it('meldt het wanneer de status niet opgehaald kon worden', () => {
|
||||
render(<ProviderPanel {...props({ capabilitiesError: 'Bronservice niet bereikbaar' })} />)
|
||||
expect(screen.getByText(/bronservice niet bereikbaar/i)).toBeTruthy()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user