Federate official Belgium data sources
This commit is contained in:
@@ -0,0 +1,64 @@
|
||||
import { cleanup, render, screen } from '@testing-library/react'
|
||||
import { afterEach, describe, expect, it } from 'vitest'
|
||||
import type { AreaRead, DatasetCreateResponse, ProjectRead } from '../types'
|
||||
import { WorkbenchStatusStrip } from './WorkbenchStatusStrip'
|
||||
|
||||
const project = {
|
||||
id: 'project-1',
|
||||
name: 'Belgium and North Sea Workbench',
|
||||
region: 'Belgium and Belgian North Sea',
|
||||
} as unknown as ProjectRead
|
||||
|
||||
const areas = [{ id: 'area-1', name: 'Belgium land' }] as unknown as AreaRead[]
|
||||
|
||||
function renderStatus(datasets: DatasetCreateResponse[]): void {
|
||||
render(
|
||||
<WorkbenchStatusStrip
|
||||
selectedProject={project}
|
||||
areas={areas}
|
||||
datasets={datasets}
|
||||
qualityChecks={[]}
|
||||
exports={[]}
|
||||
activeLayerFeatureCount={1}
|
||||
selectedAreaHasGeometry
|
||||
/>,
|
||||
)
|
||||
}
|
||||
|
||||
afterEach(cleanup)
|
||||
|
||||
describe('WorkbenchStatusStrip analytical readiness', () => {
|
||||
it('treats the persisted NGI administrative baseline as analyzable', () => {
|
||||
renderStatus([
|
||||
{
|
||||
id: 'dataset-1',
|
||||
dataset_type: 'vector',
|
||||
source: 'operator_official_import',
|
||||
source_name: 'ngi_adminvector',
|
||||
reference_layer_name: 'belgium_municipalities',
|
||||
dataset_role: 'reference',
|
||||
status: 'ready',
|
||||
} as unknown as DatasetCreateResponse,
|
||||
])
|
||||
|
||||
expect(screen.getByText('Kaartwerkruimte is gebruiksklaar')).toBeTruthy()
|
||||
expect(screen.getByText("1 analysethema")).toBeTruthy()
|
||||
})
|
||||
|
||||
it('does not call an unrelated stored context file an analysis theme', () => {
|
||||
renderStatus([
|
||||
{
|
||||
id: 'dataset-2',
|
||||
dataset_type: 'vector',
|
||||
source: 'manual',
|
||||
source_name: 'manual',
|
||||
reference_layer_name: 'custom_context',
|
||||
dataset_role: 'reference',
|
||||
status: 'ready',
|
||||
} as unknown as DatasetCreateResponse,
|
||||
])
|
||||
|
||||
expect(screen.getByText('Kaartwerkruimte vraagt aandacht')).toBeTruthy()
|
||||
expect(screen.getByText("0 analysethema's")).toBeTruthy()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user