Commit d0596b2
committed
Fix mock decision context to flatten user attributes
The test context in DecisionFunctionModal nested attributes under an
"attributes" key, but the real proxy flattens them as top-level fields
on ctx.session.user. This caused runtime errors (e.g. "Cannot read
properties of undefined") when testing decision functions that access
custom attributes like ctx.session.user.departments.
Added cross-reference comments in both context.rs and the modal to
prevent future drift between the real and mock context shapes.1 parent 5b48a09 commit d0596b2
2 files changed
Lines changed: 7 additions & 1 deletion
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
348 | 348 | | |
349 | 349 | | |
350 | 350 | | |
| 351 | + | |
| 352 | + | |
| 353 | + | |
| 354 | + | |
351 | 355 | | |
352 | 356 | | |
353 | 357 | | |
| |||
357 | 361 | | |
358 | 362 | | |
359 | 363 | | |
360 | | - | |
| 364 | + | |
361 | 365 | | |
362 | 366 | | |
363 | 367 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
48 | 48 | | |
49 | 49 | | |
50 | 50 | | |
| 51 | + | |
| 52 | + | |
51 | 53 | | |
52 | 54 | | |
53 | 55 | | |
| |||
0 commit comments