Testing¶
The CPSV Editor's automated test suite runs on Vitest, and covers the pure-logic core the editor depends on โ TTL generation and parsing, DMN XML handling, validators, the iKnow import mapping โ plus the state hooks, the network-boundary utilities, every tab component, and four end-to-end journeys driven against a live stack.
The testing roadmap that ran from P0 to P7 is complete: every phase has landed, and the per-file 80% branch floor is enforced natively by the runner.
Figures on this page are measured, not estimated
Every unit-suite figure below was re-measured against v2026.11.3 on
28 November 2026 at c3105f0 on main (run at 4ec37df, whose tree is
identical), on Vitest 5.1.0 and Node v24.22.2 โ .nvmrc now names
24.22.3. A first run, made while the machine was short of memory, lost
files to workers that failed to start and was discarded; each suite was
then run on its own. The full run with coverage reported 76 files and
903 tests, all passing, in 124.00 s (Vitest's own duration; 208 s wall
clock). v2026.11.3 added 9 tests. test:p2 and test:p5, whose files
changed, were also run alone and agree; test:app and test:p4, each one
test up in one file, are counted from the full run's per-file figures, and
the other scripts select no changed file. The self-tests of the scripts the
supply-chain jobs run passed: dependency-gate.test.mjs (130 checks, new
in v2026.11.3), dependency-review.test.mjs (49), lockfile-diff.test.mjs
(84) and write-sbom.test.mjs (7). The release's SBOM is committed as
docs/sbom/ttl-editor-2026.11.3.cdx.json.
The end-to-end journeys were not re-run for v2026.11.3: no spec,
fixture or Playwright config changed. Nor for v2026.11.2, when only the
preflight in e2e/stack.js changed, to check Keycloak too. Nor
were they re-run for v2026.11.1, when the three stack journeys began to sign
in as lde-e2e before deploying, which needs Keycloak on :8080 and
LDE_E2E_PASSWORD in the shell โ see
below. Their figures are carried
forward from 10 October 2026, against v2026.10.1 on a local stack โ the Linked
Data Explorer backend on :3001, Operaton on :8081, and this editor's dev
server started by Playwright's own webServer on :3000: 4 passed in
42.4 s, with Playwright 1.63.0. The lockfile now holds 1.65.1.
Rerun the commands in Running the tests to reproduce
them.
At a glance: 76 files ยท 903 tests ยท all passing ยท 124.00 s for a full run with coverage on this measurement, plus 4 end-to-end journeys run separately (last run on 10 October 2026).
Coverage: 91.54% statements ยท 89.53% branches ยท 82.43% functions ยท 92.28% lines, with every file at or above the 80% branch floor.
Measure after npm ci, never after npm install
npm install has reported "up to date" here while node_modules still
held the old versions of a just-bumped dependency โ npm had written the
new ones into its hidden lockfile without replacing the package directories.
A run against that tree reports a green suite measured on the wrong
instrument. CI is immune because it installs with npm ci on a clean
runner; a local run is not.
Running the tests¶
All tests run on Vitest 5. react-scripts and Create React App are gone as
of v2026.09.1 โ see The Vite migration. Run everything
from the repository root after npm ci.
| Command | Scope | Suites | Tests |
|---|---|---|---|
npm run test:ci |
Everything, once, with coverage | 76 | 903 |
npm test |
Everything, interactive watch mode | 76 | 903 |
npm run test:generator |
TTL generator regression tests | 9 | 131 |
npm run test:roundtrip |
TTL round-trip, parser and import tests (P1) | 5 | 61 |
npm run test:app |
The src/App.* suites |
6 | 34 |
npm run test:p2 |
Pure-logic utilities, the vendor-logo scaler, and the phase-script guard (P2) | 11 | 205 |
npm run test:p3 |
State hooks (P3) | 3 | 37 |
npm run test:p4 |
Network-touching utilities and sign-in state (P4) | 7 | 86 |
npm run test:p5 |
Tab components, PreviewPanel, PublishDialog, sign-in controls (P5) | 28 | 240 |
npm run test:p6 |
DMNTab's full lifecycle (P6) |
7 | 109 |
npm run test:e2e |
Playwright journeys (P7) โ needs a live stack | 4 | 4 |
Each scoped script has a :watch counterpart. Every test file belongs to at
least one phase script: src/testing/phaseScripts.test.js (3 tests, run by
test:p2) reads the scripts from package.json, walks src/ and fails, naming
the file, when a test file matches no phase script's filter, or when a :watch
script selects other files than its run script. The filters are path substrings
and may overlap, but on this measurement none does: the eight scripts' counts
sum exactly to the full run's 76 files and 903 tests.
End-to-end journeys need a live stack¶
test:e2e drives the real application against a real backend and a real engine,
with nothing mocked between the browser and Operaton. It is not wired into
CI โ playwright.config.js says so in as many words: three of the four journeys
need the Linked Data Explorer backend and an Operaton engine, neither of which
exists on a runner. The fourth, amsterdam-reimport-journey, only imports and
downloads files and calls neither, so it runs without a stack: the preflight
below is a fixture that only the three stack journeys use. That makes it the one
journey that could be wired into CI first; no workflow runs it yet.
Since v2026.11.1 the three stack journeys sign in first (noted 12 November 2026).
Deploying needs the lde-author role, so each opens the header's Sign in โ
Medewerker popup and signs in as lde-e2e โ or LDE_E2E_USERNAME โ with the password
from LDE_E2E_PASSWORD. Set it in the shell that runs the journeys; Playwright loads no
.env file:
That makes Keycloak a third service of the stack: http://localhost:8080, realm ronl,
with the account that ronl-business-api's scripts/keycloak-add-lde-clients.sh --with-e2e
creates and a ttl-editor client registered for http://localhost:3000, the port
Playwright's webServer uses. The preflight below checks Keycloak too: realm ronl has
to answer its OpenID configuration, so a Keycloak that is down, or one without the realm,
is named before a journey starts instead of surfacing as a 30-second wait for Sign out
in e2e/signIn.js. An account without the role fails at sign-in, with that reason. The
journeys have not been re-run since the sign-in was added, nor since the preflight
began checking Keycloak.
| Command | What it does |
|---|---|
npm run test:e2e |
Headless, and opens the HTML report when it finishes |
npm run test:e2e:headed |
A real browser window, actions slowed to 400 ms |
npm run test:e2e:ui |
Playwright UI mode |
A preflight fixture checks all three services first and names what is missing โ
the backend, Operaton and Keycloak's realm ronl, once per run, for the three journeys
that use them โ because
the failure otherwise arrives disguised: a connection refused surfaced as an
amber validation banner, or as a deploy that quietly never enabled the Evaluate
button, with the runner then reporting a timeout on a button several steps from
the cause. The backend and Keycloak URLs are read from .env.development
(VITE_BACKEND_URL, VITE_KEYCLOAK_URL) rather than hardcoded, unless
E2E_BACKEND_URL or E2E_KEYCLOAK_URL overrides them, so the preflight checks the
same hosts the application will call. For Keycloak an answer is not enough: it must
succeed, because a Keycloak without the realm answers 404.
Since v2026.11.0 the Service tab asks the backend for the dataset's published
services as soon as it renders. In the stack-free re-import journey nothing
answers, so the run logs a failed fetch and a
[RequiredServices] Could not load published services warning, and the tab
shows its amber "you can still paste a URI" note. That is expected, not a
failure; the journey asserts nothing about the Service tab's list.
UI mode waits for you to press play
An idle UI-mode window with an empty trace pane reads as a hang. It is not: the runner discovers the tests and then waits, so no dev server starts and nothing reaches the backend until play is pressed.
# Full suite, non-interactive, with a coverage report
npm run test:ci
# Day-to-day watch mode
npm test
# One layer in isolation
npm run test:p2
npm test is watch mode โ it does not exit
Use npm run test:ci in CI, scripts, or anywhere a process must terminate.
--coverage lives on test:ci and not on npm test, so a watch run
reports no coverage figures.
Under heavy machine load Vitest's fork workers can time out while starting, which reports files as failed to start although no test failed; rerun the suite on a quieter machine before reading anything into it.
Linting and formatting¶
Not tests, but part of the same pre-push gate:
| Command | What it does |
|---|---|
npm run lint |
eslint . โ the flat config lints src/**, e2e/**, the root config files and scripts/**/*.{js,mjs} |
npm run lint:fix |
The same, applying fixable corrections |
npm run check-format |
Prettier in check mode over the whole tree |
npm run format |
Prettier in write mode over the whole tree |
Git hooks¶
Husky installs two hooks:
| Hook | Runs |
|---|---|
pre-commit |
npx lint-staged |
pre-push |
npm run deps:check, then npm run lint, then npm run check-format |
deps:check runs first since v2026.09.5: a clone whose install has fallen behind
the lockfile stops there with npm ci named, instead of failing lint or the
format check on the wrong tool versions. npm start runs the same check before
Vite starts. It also warns when the machine's npm is older than 11.10, which
ignores the 14-day cooldown in .npmrc without a word.
The hooks do not run the tests
pre-push gates on the install, lint and formatting only, so nothing client-side stops
a push that breaks the suite โ run npm run test:ci yourself before
pushing. The deploy pipelines do run it, and Build and deploy ACC is a
required check on acc, so a pull request that fails the suite cannot be
merged there; see CI.
Note that check-format runs across the whole tree, not just staged
files โ a Prettier violation in a Markdown file fails the push just as a
source file would.
Since v2026.09.2 formatting is also checked in CI, in the audit job
rather than the deploy workflows. Those skip changes confined to docs/**,
.claude/** and **/*.md, so a check placed there would never see markdown โ precisely
what drifts, since lint-staged only formats src/** and package.json on
commit.
CI¶
Eight workflows run in this repository. Every job runs on ubuntu-24.04.
| Workflow | Job | Runs |
|---|---|---|
| Deploy ACC (orange-beach) | changes, then Build and deploy ACC |
changes decides whether a pull request touches anything outside docs/**, .claude/** and **/*.md; then Node from .nvmrc โ npm ci โ npm run lint โ npm run test:ci โ npm run build โ upload dist/ to acceptance |
| Deploy PROD (white-sky) | Build and deploy PROD |
The same sequence without changes, deploying production |
Supply-chain audit (zizmor.yml) |
audit |
On Node 24.22.3: zizmor 1.29.0, renovate-config-validator --strict, Lockfile matches package.json (npm ci --dry-run --ignore-scripts), npm run check-format, npm run check-supply-chain, and Verify registry signatures (npm run audit:signatures) |
Supply-chain audit (zizmor.yml) |
lockfile-review, lockfile-review-comment |
On every pull request: a read-only job runs the self-tests of the lockfile diff and the dependency gate and checks dependency-register.json, so a malformed register fails even with the lockfile unchanged; when package-lock.json changed it then runs the lockfile diff and the dependency gate (v2026.11.3), and a separate job holding the write token posts the one review comment โ no unit suites |
Semgrep (semgrep.yml) |
scan |
Semgrep Code and Supply Chain โ see Dependency Scanning |
| Close preview environments | Close ACC staging environment, Close PROD staging environment |
Deletes a pull request's Static Web Apps preview when it closes โ no tests, but see below |
Dependency audit (dependency-audit.yml) |
dependency-audit |
Daily at 05:17 UTC: npm audit --package-lock-only on both acc and main, failing on a high or critical production advisory โ no tests |
Release SBOM (sbom.yml) |
release-sbom |
Checks the committed CycloneDX SBOM before regenerating it โ strictly on the release pull request, existence only on a push to main โ no tests |
Dependency review (dependency-review.yml) |
dependency-review |
Quarterly, on the second day of January, April, July and October: opens the quarter's review issue for every direct dependency, and since v2026.11.3 lists the register's open overrides and the previous quarter's Renovate security exceptions โ no tests |
Preview environments close from a workflow with no path filter (v2026.09.6). The
close jobs used to live in the deploy workflows, whose paths-ignore applies to the
close event too, so a pull request that changed only documentation never started the
workflow holding its close job, and its preview kept running. Four previews on ACC and
four on PROD had been left that way, each serving a public URL with old code and
holding one of the ten slots the Static Web Apps Standard plan allows. The close jobs
now trigger on every pull-request close for acc and main; closing an environment
that was never created succeeds and does nothing. GitHub starts no workflow at all for
a pull request with a merge conflict, so the release procedure also runs
npm run check-previews, which lists orphaned previews and prints the exact delete
command without running it.
The two deploy workflows run lint and then the full suite, then build the bundle
on the runner, and a failure anywhere blocks the deploy. The deploy action only
uploads dist/ (skip_app_build: true), so the tree the tests ran against is
the tree that ships, on the Node .nvmrc names. Until 20 August 2026 the
workflows ran nothing of ours at all: they went from checkout straight to the
Static Web Apps action, which built inside its own container.
Documentation-only changes get no test run and no preview environment โ if
you changed only Markdown and expected a green tick from the suite, that is why.
On a pull request into acc, the changes job decides this and Build and
deploy ACC is skipped, which reports as a pass; a failed lookup builds in
full. Pushes, and pull requests into main, filter at the trigger with
paths-ignore. The audit workflow goes the opposite way: it has no branches
filter and runs on every pull request, including one based on another feature
branch. While it had one, a stacked pull request accumulated no audit and GitHub
reported it as clean with zero checks, then blocked it permanently once the base
was retargeted to acc.
The acc supply-chain gate ruleset makes this enforcement rather than
reporting: acc requires a pull request, and audit, scan, Build and
deploy ACC and lockfile-review are required status checks. A workflow that runs but cannot block is
advice โ and requiring the checks without also requiring a pull request would
still let a direct push past them. There are no bypass actors, so this applies to
releases and to the repository owner alike. Since 30 September 2026 the
main promotion gate ruleset does the same for main: a pull request, merged
with a merge commit, and audit and scan as required status checks โ but
not Build and deploy PROD โ again with no bypass actors. Neither branch has classic branch protection any more; the
two rulesets are the whole gate. The mechanics are covered in
Supply-Chain Pinning.
audit does not run the tests, and the deploy job does not run the audit
They are separate gates on the same pull request. audit reasons about the
pipeline's own supply chain; Build and deploy ACC reasons about the code.
A pull request into acc needs both, and scan, to be green before it can
merge โ and because the deploy job skips a documentation-only pull request
while the audit does not, such a pull request is in practice gated by
audit and scan alone.
Test inventory¶
Test files are colocated with the source they cover (foo.js โ
foo.test.js). Counts are per file, as reported by Vitest.
Core: TTL generation and parsing¶
| File | Tests | Style | Covers |
|---|---|---|---|
src/parseTTL.requires.test.js |
8 | Pure unit, inline Turtle | dct:requires read back one per line, as a comma list and as an object list continued onto the next lines; a URI containing field names leaks into none of them; bare a cpsv:PublicService . stubs before or after the service never become the service; and a round trip keeps the list (v2026.11.0) |
src/parseTTL.predicates.test.js |
8 | Pure unit, inline Turtle | Bare-named fields read only from their predicate: a sector URI containing "sector" read whole, a description mentioning sector, thematic area, validFrom or validUntil leaving the field alone, a sector URI inside a required service not leaking into the sector, and the legacy ronl: and cprmv:extends/cprmv:confidence forms still read (v2026.11.2) |
src/parseTTL.statementEnd.test.js |
7 | Pure unit, inline Turtle | A statement ends at its full stop outside literals and IRIs: a closing literal containing ";" still ends a temporal rule, parameter, concept or CPRMV rule; a "." mid-text or only inside an IRI does not; a full stop on its own line, after a typed literal or before a comment still does (v2026.11.2) |
src/parseTTL.roundtrip.test.js |
14 | Real fixtures, no mocks | Parses a real reference export, regenerates TTL from the parsed state, then parses again โ comparing business fields between the two parses rather than diffing against the original file's formatting |
src/utils/ttlGenerator.sections.test.js |
29 | Pure unit | The skeleton the others sit in: generate() assembles a dozen optional sections, each behind its own condition โ service identifier and sector, organisation logo, legal resource, temporal rules |
src/utils/ttlGenerator.uris.test.js |
26 | Pure unit | The URI and date helpers every emitter shares โ legal-resource and ruleset URIs, cprmvValidFrom, rules-derived dates, CPRMV rule subject URIs. A wrong one does not throw; it publishes a graph that parses and points at the wrong resources |
src/utils/ttlGenerator.entities.test.js |
23 | Pure unit | Parameters, cost, output and the vendor service โ above all that an empty field produces no triple, never a triple with an empty literal |
src/utils/ttlGenerator.dmn.test.js |
11 | Pure unit | The DMN section for a model uploaded in this editor โ deployment, test and validation history, each optional and each its own predicate |
src/utils/ttlGenerator.cellGrounding.test.js |
18 | Pure unit | Per-cell cprmv:Rule emission, concept dedup, nested hasPart for compound cells, and the SHACL-conformance rules โ see Cell-Level Legislative Grounding |
src/utils/ttlGenerator.versionTarget.test.js |
7 | Pure unit | The CPRMV version selector โ namespace and shape differences between the 0.4.1 and 0.3.2 targets |
src/utils/ttlGenerator.dateAxis.test.js |
3 | Pure unit | Rules-derived consolidation dates and duplicate-path rule URIs |
src/utils/ttlGenerator.requires.test.js |
6 | Pure unit | One dct:requires line per entry inside the service block, no cpsv:PublicService stub for a required service, byte-identical output when nothing is required, never the service requiring itself, and a valid closing line when dct:requires is the last property (v2026.11.0) |
src/utils/ttlGenerator.citationStub.test.js |
8 | Pure unit + the real export | The typed stub minted for a cprmv:isBasedOn citation โ and no stub for a rule the same document already publishes, which asserted a second, contradictory cprmv:id. Half the file regenerates the real SZW normenbrief export and checks no subject carries two ids |
src/utils/ttlHelpers.test.js |
32 | Pure unit | All ten TTL string/URI helpers โ escaping, sanitising (filenames, ruleIdPath, IRIs), formatting. sanitizeIri is checked for idempotence and for leaving structural URI characters (/, :, #, ?) intact |
Round-trip fixtures are the real reference exports in examples/ โ
full-test.ttl, full-test-import-export.ttl, the DMN-free
organizations/svb/Bepaling-leeftijd-AOW.ttl, and, since v2026.10.0, the
published organizations/amsterdam/Digital-Twin-Inkomensregelingen.ttl, which
carries the whole cell-level grounding layer. dmnData is derived from each
fixture's own hasDmnData/importedDmnBlocks the way importHandler.js
really does it, so the tests exercise a shape the app actually produces.
An equality check between two parses cannot see a defect both parses share, so
three tests assert values instead. A published export types four different
things a cprmv:Rule โ Norms & Standards rules, and the grounding layer's cell
resources, minted concepts and citation stubs โ and on
full-test-import-export.ttl the tests check that only the six subjects under
the policy-rule base become rules, that the grounding resources stay in the
preserved DMN block, and that regenerating invents no policy rule for any of
them. Until v2026.10.0 the importer took all four for policy rules.
examples/ronl.ttl is deliberately excluded โ it is the RONL SKOS vocabulary
file, not a CPSV-AP service export, and parseTTLEnhanced correctly throws on
it.
Pure-logic utilities (P2)¶
| File | Tests | Style | Covers |
|---|---|---|---|
src/utils/dmnHelpers.test.js |
55 | Real DOM parsing (jsdom DOMParser) |
Primary-decision-key extraction (root detection, p_* constant skipping, multi-root tie-breaking), rule and cell extraction, validateDMNData, concept generation, evaluateTestCaseExpectation, extractOutputsFromDMN |
src/utils/validators.test.js |
29 | Pure unit | All eight exports: the six per-section validators, the validateForm aggregation across every section including array fields, and the isValidDate helper |
src/utils/iknowParser.test.js |
31 | Real DOM parsing | Both iKnow XML export formats, format auto-detection, the field-map helper, the dot-path value extractor, and applyMapping including filters and transforms โ plus the two guards: prototype path segments are neither read nor written, and a nested-quantifier or over-long transform pattern throws |
src/utils/cprmvImport.test.js |
13 | Pure unit | flattenCprmvRules โ sub-clause folding, namespace variants (0.4.1 slash, 0.3.0 contains, legacy flat arrays), multi-entry input, malformed input tolerance, id uniqueness |
src/utils/logoImage.test.js |
5 | Pure unit | fitWithin, the size a vendor logo is scaled to (v2026.11.3): an image that fits is left alone, a wide or a tall one is scaled to 512 px on its longer side with its proportions kept, no side is rounded down to 0, and the maximum is 512. readScaledImage, which reads and draws the file, is tested through the Vendor tab (P5) |
src/utils/ronlHelper.test.js |
5 | global.fetch mock |
The two SPARQL functions that query the RONL vocabulary through the shared backend proxy |
State hooks (P3)¶
| File | Tests | Style | Covers |
|---|---|---|---|
src/hooks/useArrayHandlers.test.js |
15 | renderHook + a useState harness |
Array CRUD handlers, the four default-item factories, and the pre-configured wrapper hooks. New ids continue from the highest existing id, not the array length |
src/hooks/useDsoImport.test.js |
9 | renderHook + fetch mock + real window.history |
The DSO โ DMN deep-link import: no-op paths, params stripped before the fetch resolves, error branches, and the full success path prefilling three tabs |
src/hooks/useEditorState.test.js |
13 | renderHook + mocked ronlHelper |
Initial defaults, the mount effects โ since v2026.11.1 including the publish target the required-services picker is built from โ and clearAllData, including its documented exception that TriplyDB config is not cleared, and that each reset gets its own requires list rather than the shared default (v2026.11.2) |
Network-boundary utilities (P4)¶
| File | Tests | Style | Covers |
|---|---|---|---|
src/utils/triplydbHelper.test.js |
33 | global.fetch mock + the utils/auth test double |
All seven exports since v2026.11.1: graph-IRI construction, the dataset-name check, the one publish call to the backend with the author's token (its warning, 401/403, problem-detail, bare-status and network-failure branches, and since v2026.11.3 a 200 whose body is not JSON, which counts as published), the dataset check through the backend, the publish target, and the localStorage config that keeps only the dataset and removes an older version's token |
src/utils/shaclHelper.test.js |
4 | global.fetch mock |
validateTtl โ success, a parsed-but-invalid backend response, and the distinct unavailable shape on network failure. SHACL validation is advisory and must never block publishing |
src/utils/serviceCatalogHelper.test.js (11 tests, v2026.11.0) is the same kind of
test โ a plain global.fetch mock โ for the published-services list behind the Service
tab's required services: the dataset's SPARQL URL, a null for each missing config
field, the query posted through the backend proxy without credentials, one entry per
service when it has several titles, and an error on a non-ok or unsuccessful response.
test:p4 selects it, with problem, the sign-in modules (utils/auth, authState)
and deployOptions. src/utils/deployOptions.test.js (3 tests, v2026.11.2) covers
the test-deploy offer: returned when enabled, and null when disabled, on an HTTP
error, a malformed body or a network failure.
src/utils/problem.test.js (7 tests, v2026.09.6) belongs with these, and test:p4
runs it: it pins getProblemDetail, which reads the backend's RFC 9457 detail
first and still understands the older error.message and bare-string error shapes.
src/App.lazyTabs.test.jsx (6 tests) covers the lazy tabs, including the DSO deep link
that used to leave the DMN tab highlighted over an empty panel, and since v2026.11.1 that
Clear All remounts the DMN tab empty; test:app runs it with the other five src/App.*
suites.
Sign-in (v2026.11.1). src/utils/auth.test.js (25 tests) is the one suite that
unmocks utils/auth and drives the real module against a mocked keycloak-js: the
silent check only after an earlier sign-in, the popup and its redirect fallback, the
popup reporting back or being closed โ since v2026.11.2 including a late report from the
tab's own popup starting no second check โ sign-out, the lde-author role, and
authHeaders() refreshing a token or falling back to signed out.
src/testing/authState.test.js (3) pins the test double every other suite runs
against: setupTests.js mocks utils/auth with it, so each test starts signed in as an
author and a test about the signed-out states sets that state itself.
src/components/SignInMenu.test.jsx (11) covers the two routes, the name and Sign
out, the dismissible View only note, and the note's wording with and without a
test-deploy offer, which an author never asks for; src/components/LockedAction.test.jsx (4)
the locked button and its two hints.
These use a plain global.fetch mock rather than msw. Every function here
is a single self-contained fetch call rather than a multi-request flow, so the
lighter approach stays proportionate; msw is worth revisiting if a future
phase needs to model a multi-endpoint flow or share fixtures across many
tests.
Smoke test (P0)¶
| File | Tests | Covers |
|---|---|---|
src/App.test.jsx |
1 | Renders <App /> and asserts on the real header. Replaces CRA's stock "learn react link" stub, which asserted text this app never rendered and had kept test:ci red since the project was scaffolded |
Tab components and dialogs (P5)¶
Twenty-eight files, 240 tests. Deliberately thin and even: every component
renders with realistic props, and one representative interaction proves the
controlled-component contract. No component is left at zero, and src/components
moved from 3.9% to 41% statements in this phase alone.
These tests found a latent crash in IKnowMappingTab, which reads
mappingConfig.mappings unguarded inside an expression short-circuited by an
empty configuration name โ so a config without that key renders fine and throws
the moment someone types a name.
They also pinned something that was invisible: VendorTab switches on the
vendor URI rather than a capability flag, so iKnow gets integration tooling,
Blueriq gets the contact form, and every other vendor gets an "under development"
placeholder. Adding a vendor to the concept list gives it a dropdown entry and
nothing else.
VendorTab.logo.test.jsx (2 tests, v2026.11.3) uploads a logo through the Vendor tab,
with the browser's image decoding and canvas stubbed because jsdom has neither: a
2048 ร 1024 logo is drawn at 512 ร 256 and stored as the PNG the canvas returns, and a
300 ร 120 logo keeps its size. No test yet feeds it a file that cannot be decoded.
ServiceTab.test.jsx gained eleven tests in v2026.11.0, for the Required services
section: the published list without the service itself,
adding from it and from a pasted URI (trimmed, de-duplicated, angle brackets
stripped), every rejection โ the service's own URI, a non-http(s) value, characters
Turtle does not allow in an IRI โ removal by title, pasting after the list failed
to load, no fetch without a config, and Refresh list fetching again. v2026.11.2
added the picker's states, for 24 tests in all: Refresh list disabled without a
dataset, Add disabled until a service is chosen, a rejection clearing on Remove
and on typing, the previous dataset's list hidden while a new one loads, and no refetch
when only the token changes. RequiredServicesSection.jsx has no test file of its own
and reaches 98.48% statements, 95.74% branches and 100% functions and lines through
these.
DMNTab lifecycle (P6)¶
Seven files, 109 tests, covering validate โ deploy โ evaluate. DMNTab.signin.test.jsx
(10 tests, v2026.11.1) adds the three Deploy states โ an author's deploy with a token, the
test deploy to TestOnly with evaluations sent to that tenant, and the locked button
where the backend offers no test deploy โ and a refused deploy shown under the button,
and, since v2026.11.2, an author whose session lapsed at click time asked to sign in
again rather than test-deployed. The suite walks the
real lifecycle rather than testing each call in isolation, because the interface
enforces that order: the Evaluate button stays disabled until a deployment has
succeeded.
Two findings worth keeping. The unreachable-backend path is a deliberate third
outcome โ not valid, not invalid, but skipped โ and is now pinned as one. And
handleDeployDMN's opening guard is unreachable: the Deploy button renders inside
the branch that requires an uploaded file, so the error it raises can never fire.
End-to-end journeys (P7)¶
Four Playwright specs, three of them run against a live stack rather than mocks.
None of them changed in v2026.10.2 or v2026.11.0. In v2026.11.1 the three stack
journeys gained a sign-in as lde-e2e before deploying (see
above), and they were not re-run for it. No
spec changed in v2026.11.2 or v2026.11.3; in v2026.11.2 the preflight now also checks Keycloak, and a run today ends
its preflight line with , Keycloak http://localhost:8080/realms/ronl (HTTP 200). The
figures below are carried forward from 10 October 2026. Last measured on 10 October 2026 against v2026.10.1 on a local stack โ the Linked Data
Explorer backend on :3001, Operaton on :8081, and the dev server Playwright's
webServer started on :3000. The re-import journey ran first and without the
preflight; the preflight then confirmed both services once, for the other three:
npx playwright test --reporter=list
# โ amsterdam-reimport 12.0 s
# preflight ok โ backend http://localhost:3001 (HTTP 200), Operaton http://localhost:8081 (HTTP 200)
# โ authoring 8.9 s ยท โ normbedragen 4.9 s ยท โ round-trip 2.7 s
# 4 passed (42.4s)
--reporter=list rather than npm run test:e2e, which opens the HTML report when it
finishes โ fine at a desk, a hang in anything scripted.
| Spec | What it proves |
|---|---|
e2e/authoring-journey.spec.js |
The application can create a service: empty form โ real deploy โ real evaluation โ exported TTL |
e2e/round-trip-journey.spec.js |
It can read an existing one back: import a full TTL, swap its decision model, deploy, evaluate, download and check what was written |
e2e/normbedragen-journey.spec.js |
One deployment answers repeatedly: a chained DRD deployed once, evaluated with four request bodies that differ only in the peildatum, then exported. Added in v2026.09.3 with the 2026-H2 bijstandsnormen |
e2e/amsterdam-reimport-journey.spec.js |
Reading a published file and writing it straight back changes nothing: imports the published Amsterdam export Digital-Twin-Inkomensregelingen.ttl, downloads it, imports that download and downloads again. Asserts the Policy tab stays empty, no rules/incomplete_ or other fabricated rule subject appears, the cell grounding (a cprmv:sourceQuote, a concept's skos:prefLabel, a cell resource) survives both exports, and the second export equals the first once export timestamps are blanked. Calls neither Operaton nor the backend. Added in v2026.10.0 |
E2E_BASE_URL points the journeys at a deployed build โ and at production's engine
Since v2026.09.3 E2E_BASE_URL drives the journeys against an already-deployed
app instead of a local dev server, and drops the webServer block so none is
started. The journeys are not read-only: each clicks Deploy to Operaton
and leaves a deployment behind, and the fixtures use real decision keys.
.env.acceptance and .env.production name the same engine,
https://operaton.open-regels.nl, so a run against acceptance deploys a real
version of those keys into the engine production evaluates against โ and
Operaton versions a duplicate key rather than rejecting it, so a consumer that
evaluates by key then answers from the test fixture. Only a local stack,
.env.development's localhost:8081, is free of that.
The app also calls the backend and the Keycloak it was built against:
E2E_BACKEND_URL and E2E_KEYCLOAK_URL redirect the preflight probes, not the
application, and without them the preflight still checks the hosts in
.env.development. Driving a deployed build means driving its stack.
Since v2026.11.1 the stack journeys sign in as lde-e2e before they deploy.
ronl-business-api's keycloak-add-lde-clients.sh refuses to create that account
on production, so against production the sign-in fails before anything is
deployed. Against acceptance, where the account can exist, the warning above holds.
The journeys that evaluate assert values rather than status codes โ the round-trip journey zorgtoeslag 1150 and a specific annotation string โ because a decision table that stopped matching would still answer 200 with an empty result set. That assertion was verified to bite by setting the expected value wrong and watching the test fail. The export assertion reads the downloaded file rather than trusting the filename, since a filename check passes on an empty file.
Fixtures live in e2e-fixtures/ with a manifest recording each one's provenance,
so editing an example cannot silently change what a test asserts.
The authoring journey found a defect no unit test could reach: below 1600px the preview panel, mounted fixed and 500px wide, covers the header controls โ at 1280px, opening the preview leaves no way to close it. The suite runs at 1600ร900 so the journey is not blocked, and the threshold is documented rather than dodged.
Coverage¶
Measured with Vitest's --coverage (npx vitest run --coverage, what
npm run test:ci runs) against v2026.11.3 on 28 November 2026, at c3105f0.
Overall: 91.54% statements ยท 89.53% branches ยท 82.43% functions ยท 92.28%
lines โ against 54.75% / 40.88% / 38.68% / 55.57% at v2026.09.0. The jump is
P5, P6 and the branch-floor work landing together; v2026.09.3's two parser guards
moved src/utils a little further. At v2026.10.0 src/utils rose again and
src/config fell, to 81.13% branches. v2026.10.1 changed no source file; the
small moves since v2026.10.0, src/components branches among them, come from
Vitest 5's coverage provider counting the same code slightly differently.
v2026.11.0's two new source files arrived fully tested โ RequiredServicesSection.jsx
at 100% on every measure and serviceCatalogHelper.js at 100% statements and 95.65%
branches โ which is what moved src/utils and src/components/tabs up; src rose
with the parser's new dct:requires branches. v2026.11.1 moved every measure up again:
App.jsx lost most of its publish handler to the backend, which lifted src to
68.33% functions, and the sign-in files arrived tested โ LockedAction.jsx,
SignInMenu.jsx and useAuth.js at 100% on every measure, auth.js at 98.87%
statements and 94.11% branches โ taking src/components to 100% functions.
v2026.11.2 moved the totals by less than a fifth of a point either way. Branches rose,
to 89.46%: PublishDialog.jsx's three-step list took src/components to 94.55%
branches, and the parser's two new helpers arrived covered. Functions fell, to 81.97%:
App.jsx stands at 61.40% (35 of 57), from 65.45% โ the logo warning's two new
callbacks are covered, but no test reaches the timers that close the dialog and clear
the message after a warning, or clear it after a success โ which took src down on
every measure. RequiredServicesSection.jsx, reworked for its loading states, stands
at 98.48% statements and 95.74% branches.
v2026.11.3 moved every total up, functions the most, to 82.43%. App.jsx rose to
80.49% statements, 84.70% branches and 64.91% functions with the unreadable-answer
test, lifting src on every measure, and the Vendor tab's logo tests lifted
src/components/tabs. The new logoImage.js arrives at 84.61% statements, 85.71%
branches and 71.42% functions: no test reaches its two error callbacks, for a file
that cannot be read or decoded, or the branch for a browser without a canvas, so
src/utils fell slightly on every measure, most on functions.
| Area | Statements | Branches | Functions | Lines |
|---|---|---|---|---|
src/hooks |
100% | 94.20% | 100% | 100% |
src/utils |
95.28% | 89.78% | 97.43% | 96.20% |
src/testing (the utils/auth test double) |
93.75% | 100% | 90.00% | 92.85% |
src/config |
90.56% | 81.13% | 75.00% | 90.19% |
src/components |
93.63% | 94.55% | 100% | 96.03% |
src/components/tabs |
85.98% | 92.66% | 69.36% | 86.22% |
src (App, index, parser) |
88.57% | 82.53% | 68.75% | 89.75% |
The rows are the runner's own per-directory figures, so src/components counts only the
files directly in that folder โ the dialogs and panels โ and the tabs have a row of their
own. That split is where the functions gap is: the tabs are well branched and thinly
exercised as whole handlers.
src/components was at 4.05% branches before the P5 and P6 work landed.
Every file clears the 80% branch floor¶
The floor is enforced natively โ thresholds: { branches: 80, perFile: true } โ
so this is a gate rather than a report. See
The Coverage Floor for how the three
repositories reached it.
DMNTab.jsx, the largest file in the repository, is the best-covered component
at 98% branches, from 45.73% at v2026.09.1.
Three files sit one branch above the floor
ConceptsTab.jsx 80.55% (29 of 36 branches), ChangelogTab.jsx 80.70%
(46 of 57) and vocabularies.config.js 81.13% (43 of 53) โ each passes by
exactly one covered branch. Thresholds pass at >= 80, and the ratchet that
used to absorb a slip is gone, so a single added ?. or || default in
any of them turns CI red on an otherwise unrelated change.
useDsoImport.js was in the same position until v2026.09.6, when the
deep-link fix's tests took it from 80.39% to 92.15%.
What the branch column does not see
A branch floor steps straight over branch-free code. ConceptsTab.jsx reads
80.55% on branches but 71.62% statements and 63.33% functions;
App.jsx reads 84.70% / 80.49% / 64.91%. The uncovered code there is
largely whole handlers no test calls. That asymmetry is why a functions floor
is a separate decision
rather than a free companion setting.
Defects the tests found¶
Both were discovered by writing the tests, not known beforehand.
cprmv:isBasedOn was silently dropped on re-import¶
A past release renamed the generator's cprmv:extends predicate to
cprmv:isBasedOn, but the read side in parseTTL.enhanced.js was never
updated to match. From that rename until v2026.07.0, every
export-then-reimport of a temporal rule silently lost its
extends/isBasedOn relationship โ no error, just an empty field. The
round-trip test caught it on the first run. The parser now accepts both
spellings: isBasedOn first, extends for historical exports.
flattenCprmvRules minted colliding ids¶
Ids were built as Date.now() plus a sequence counter, and both were reset
on every call. Two calls landing in the same millisecond โ plausible in a fast
import flow โ produced identical ids, which collide as React keys if both
results end up in the same list. A module-level counter now keeps ids unique
for the life of the page regardless of call timing.
Documented behaviour¶
Not a bug, but a coupling worth knowing about before you change either side.
NL-SBB concepts only regenerate when a DMN model is attached in session
state. generateConceptsSection() is gated behind hasDMN() โ that is,
dmnData.isImported && dmnData.importedDmnBlocks, or dmnData.fileName &&
dmnData.content โ and not on concepts.length > 0. End to end this works
correctly, because importHandler.js derives dmnData from the imported
file. But a caller that skips that mapping and calls generateTTL with an
empty dmnData will see concepts silently vanish even though concepts still
has entries. parseTTL.roundtrip.test.js asserts both cases explicitly, so
the coupling is locked in and visible rather than a silent trap. Whether
concepts should be exportable independent of an attached DMN is a product
question, deliberately left open.
Adding tests¶
- Colocate.
foo.jsโfoo.test.js, next to the source. - Split by concern, not by file size.
ttlGenerator.jshas nine separate test files โsections,uris,entities,dmn,cellGrounding,versionTarget,dateAxis,citationStub,requiresโ rather than one large one: easier to review, and easier to see what is covered at a glance. - Add a script pair per phase. Each new phase gets
test:<phase>andtest:<phase>:watchinpackage.json, passing Vitest the file-name filters of the files it covers, mirroring the existingtest:p2/test:p3/test:p4entries. A new test file must match a phase script's filter:src/testing/phaseScripts.test.jsfails, naming it, when it matches none, and when a:watchscript differs from its run script. - Mock at the network boundary. There is no local backend to run against โ
the editor depends on the Linked Data Explorer's shared Express backend for
the SPARQL proxy, TriplyDB publishing, and DMN validation, deploy and
evaluate. Anything touching those needs a
fetchmock, not an integration target. - Update the counts on this page when a phase lands, and rerun
npm run test:cito get real figures rather than estimating.
The Vite migration¶
Create React App is gone as of v2026.09.1, migrated in four phases, each
independently revertable, in an order chosen so a working test suite exists at
every point. react-scripts provided both the build and the test runner, so
swapping the build first would have removed the regression net and the thing being
tested at the same moment โ leaving no way to tell a migration defect from a
configuration defect.
| Phase | What landed | What it proved |
|---|---|---|
| 1 | Vitest alongside Jest | Both runners reported the same 16 suites and 257 tests |
| 2 | Vite builds alongside CRA | Same eleven public assets, main chunks within a kilobyte |
| 3 | The atomic cutover | build/ โ dist/; npm audit 52 โ 10; builds ~30 s โ under 2 s |
| 4 | The shims removed | 45 jest call sites migrated, not the 43 the plan counted |
Two things the plan did not cover would have deployed green and broken: Vite
only exposes VITE_-prefixed variables, so renaming the env call sites alone
would have left both environments talking to localhost; and react-scripts was
where ESLint itself came from, so removing it would have broken the lint step that
runs before the tests.
Roadmap¶
The P0โP7 roadmap is complete. Every phase has landed:
| Phase | Scope | Landed |
|---|---|---|
| P0 | Smoke test | v2026.07.0 |
| P1 | TTL round-trip against real fixtures | v2026.07.0 |
| P2 | Pure-logic utilities | v2026.07.0 |
| P3 | State hooks | v2026.07.0 |
| P4 | Network-boundary utilities | v2026.07.0 |
| P5 | Tab components, PreviewPanel, PublishDialog |
v2026.09.1 |
| P6 | DMNTab's validate โ deploy โ evaluate lifecycle |
v2026.09.1 |
| P7 | Playwright journeys against a live stack | v2026.09.1 |
The DOM-heavy phases were sequenced deliberately after the migration, so that
bundler-sensitive work โ Tailwind/CSS processing, the JSX transform,
process.env versus import.meta.env โ was written once against the final
toolchain instead of twice.
What remains¶
Not phases, but the honest remaining edges:
- Eight uncovered branches in
DMNTab.jsx(446 of 454 covered), all guards and fallbacks the UI does not reach โif (!uploadedFile)under a button that only renders once a file exists, three early returns of the same shape, and four||/??defaults. Chasing them would mean testing through the component's internals; the file documents them as defensive dead code. - Three files one branch above the floor, with no ratchet left to absorb a regression.
- A functions floor, which is a separate decision needing its own
measurement โ
App.jsxsits at 64.91% functions against 84.70% branches.
Deliberately out of scope for now: swapping in an RDF library (the round-trip tests are the data that should decide whether the hand-rolled parser is fragile enough to justify the migration cost); authorisation per organisation, the part of the publishing-auth workstream that remains after v2026.11.1 โ see Due Diligence; and visual regression and cross-browser matrices, which are worth revisiting once the phases above are stable locally. CI wiring was on this list too, and came off it on 20 August 2026 โ see CI.
Since v2026.11.1 there is a Keycloak sign-in, one role (lde-author) and one
tenant (TestOnly), and the stack journeys sign in before they deploy. No journey
drives the signed-out or view-only paths; SignInMenu.test.jsx, LockedAction.test.jsx
and DMNTab.signin.test.jsx cover those, against the utils/auth test double. Publishing
to TriplyDB and deploying to Operaton are real side effects against shared
infrastructure; prefer a disposable or local target over the shared instances
if an E2E test ever needs to deploy for real.