Skip to content

Commit 0d8911c

Browse files
committed
Update new-dmn-check to make better null tests
1 parent 732b363 commit 0d8911c

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

.claude/commands/new-dmn-check.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -372,6 +372,21 @@ assert {
372372

373373
Use a situation where the relevant field is absent or set to `null`, triggering the null-return branch of the FEEL expression.
374374

375+
**simpleChecks-based checks**: when the check reads `situation.simpleChecks.<fieldName>`, the Null case must set the **specific boolean field** to `null` — not the entire `simpleChecks` object. This tests the inner null guard in the FEEL expression:
376+
```json
377+
"situation": {
378+
"simpleChecks": {
379+
"tenYearTaxAbatement": null
380+
}
381+
}
382+
```
383+
Not:
384+
```json
385+
"situation": {
386+
"simpleChecks": null
387+
}
388+
```
389+
375390
**Parameterless checks**: omit `"parameters"` from the request body entirely in all three test files. Do not send `"parameters": {}` or `"parameters": null`.
376391

377392
Use realistic test data: concrete IDs (e.g. `"p1"`), dates (ISO 8601), and parameter values that clearly demonstrate the pass vs. fail condition.
@@ -416,3 +431,4 @@ After writing all files, print:
416431
10. **Always import the category base module** — every check must import its category's base module DMN (e.g. `Residence.dmn`, `Age.dmn`), even if no types or BKMs from it are used in this check.
417432
11. **DMNDI: inputs below, no unused imported shapes** — input nodes must always be placed below the decision service box (higher y). Never add `DMNShape` entries for BKMs or elements from imported modules unless they are explicitly called by a `dmn:knowledgeRequirement` in this check.
418433
12. **Parameterless checks omit `parameters` entirely** — if the check has no caller-supplied parameters, remove `tParameters`, the `parameters` inputData element, its `dmn:informationRequirement`, its DMNDI shape and edge, and the `"parameters"` key from all Bruno test request bodies. An absent `parameters` input in the DMN type system is the correct way to express this; do not use an empty context or null type.
434+
13. **simpleChecks Null.bru targets the specific field** — when the check reads `situation.simpleChecks.<fieldName>`, the Null test must set that specific boolean field to `null`, not the entire `simpleChecks` object to `null`. Setting the parent object to null tests a different (shallower) branch of the FEEL null guard than is most useful.

0 commit comments

Comments
 (0)