@transitrix/diagrams 1.8.6 → 1.8.8

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. package/dist/fgca/index.js +10 -10
  2. package/dist/fgca/layout.js +1 -1
  3. package/dist/fgca/nodeTypes.js +4 -4
  4. package/dist/index.js +33 -33
  5. package/package.json +8 -2
  6. package/dist/__tests__/edge-path.test.d.ts +0 -1
  7. package/dist/__tests__/edge-path.test.js +0 -55
  8. package/dist/__tests__/node-size-presets.test.d.ts +0 -1
  9. package/dist/__tests__/node-size-presets.test.js +0 -30
  10. package/dist/__tests__/scope.test.d.ts +0 -1
  11. package/dist/__tests__/scope.test.js +0 -23
  12. package/dist/__tests__/yaml-normalize.test.d.ts +0 -1
  13. package/dist/__tests__/yaml-normalize.test.js +0 -148
  14. package/dist/activities/__tests__/cpm.test.d.ts +0 -1
  15. package/dist/activities/__tests__/cpm.test.js +0 -146
  16. package/dist/activities/__tests__/gantt.test.d.ts +0 -1
  17. package/dist/activities/__tests__/gantt.test.js +0 -263
  18. package/dist/activities/__tests__/layout.test.d.ts +0 -1
  19. package/dist/activities/__tests__/layout.test.js +0 -98
  20. package/dist/activities/__tests__/validate.test.d.ts +0 -1
  21. package/dist/activities/__tests__/validate.test.js +0 -397
  22. package/dist/activity-card/__tests__/example.test.d.ts +0 -1
  23. package/dist/activity-card/__tests__/example.test.js +0 -73
  24. package/dist/activity-card/__tests__/layout.test.d.ts +0 -1
  25. package/dist/activity-card/__tests__/layout.test.js +0 -141
  26. package/dist/activity-card/__tests__/resolver.test.d.ts +0 -1
  27. package/dist/activity-card/__tests__/resolver.test.js +0 -325
  28. package/dist/activity-card/__tests__/validate.test.d.ts +0 -1
  29. package/dist/activity-card/__tests__/validate.test.js +0 -149
  30. package/dist/actor/__tests__/validate.test.d.ts +0 -1
  31. package/dist/actor/__tests__/validate.test.js +0 -95
  32. package/dist/applications/__tests__/validate.test.d.ts +0 -1
  33. package/dist/applications/__tests__/validate.test.js +0 -223
  34. package/dist/assertion/__tests__/example.test.d.ts +0 -1
  35. package/dist/assertion/__tests__/example.test.js +0 -32
  36. package/dist/assertion/__tests__/validate.test.d.ts +0 -1
  37. package/dist/assertion/__tests__/validate.test.js +0 -130
  38. package/dist/blocks/__tests__/layout.test.d.ts +0 -1
  39. package/dist/blocks/__tests__/layout.test.js +0 -153
  40. package/dist/blocks/__tests__/validate.test.d.ts +0 -1
  41. package/dist/blocks/__tests__/validate.test.js +0 -235
  42. package/dist/business-service/__tests__/validate.test.d.ts +0 -1
  43. package/dist/business-service/__tests__/validate.test.js +0 -135
  44. package/dist/capability-map/__tests__/CapabilityMapView.test.d.ts +0 -1
  45. package/dist/capability-map/__tests__/CapabilityMapView.test.js +0 -217
  46. package/dist/capability-map/__tests__/address.test.d.ts +0 -1
  47. package/dist/capability-map/__tests__/address.test.js +0 -49
  48. package/dist/capability-map/__tests__/dsm-layout.test.d.ts +0 -1
  49. package/dist/capability-map/__tests__/dsm-layout.test.js +0 -46
  50. package/dist/capability-map/__tests__/dsm-mutations.test.d.ts +0 -1
  51. package/dist/capability-map/__tests__/dsm-mutations.test.js +0 -125
  52. package/dist/capability-map/__tests__/dsm-validate.test.d.ts +0 -1
  53. package/dist/capability-map/__tests__/dsm-validate.test.js +0 -56
  54. package/dist/capability-map/__tests__/validate.test.d.ts +0 -1
  55. package/dist/capability-map/__tests__/validate.test.js +0 -212
  56. package/dist/change/__tests__/validate.test.d.ts +0 -1
  57. package/dist/change/__tests__/validate.test.js +0 -79
  58. package/dist/codex/__tests__/example.test.d.ts +0 -1
  59. package/dist/codex/__tests__/example.test.js +0 -33
  60. package/dist/codex/__tests__/validate.test.d.ts +0 -1
  61. package/dist/codex/__tests__/validate.test.js +0 -68
  62. package/dist/compliance/__tests__/canon-catalog.test.d.ts +0 -1
  63. package/dist/compliance/__tests__/canon-catalog.test.js +0 -60
  64. package/dist/compliance/__tests__/classify.test.d.ts +0 -1
  65. package/dist/compliance/__tests__/classify.test.js +0 -58
  66. package/dist/compliance/__tests__/confidence.test.d.ts +0 -1
  67. package/dist/compliance/__tests__/confidence.test.js +0 -78
  68. package/dist/compliance/__tests__/coverage-metric.test.d.ts +0 -1
  69. package/dist/compliance/__tests__/coverage-metric.test.js +0 -264
  70. package/dist/compliance/__tests__/demo-scenario.test.d.ts +0 -1
  71. package/dist/compliance/__tests__/demo-scenario.test.js +0 -226
  72. package/dist/compliance/__tests__/example.test.d.ts +0 -1
  73. package/dist/compliance/__tests__/example.test.js +0 -51
  74. package/dist/compliance/__tests__/gap-report.test.d.ts +0 -1
  75. package/dist/compliance/__tests__/gap-report.test.js +0 -113
  76. package/dist/compliance/__tests__/html.test.d.ts +0 -1
  77. package/dist/compliance/__tests__/html.test.js +0 -122
  78. package/dist/compliance/__tests__/impact.test.d.ts +0 -1
  79. package/dist/compliance/__tests__/impact.test.js +0 -913
  80. package/dist/compliance/__tests__/markdown.test.d.ts +0 -1
  81. package/dist/compliance/__tests__/markdown.test.js +0 -85
  82. package/dist/compliance/__tests__/trace.test.d.ts +0 -1
  83. package/dist/compliance/__tests__/trace.test.js +0 -144
  84. package/dist/compliance/__tests__/view-resolution.test.d.ts +0 -1
  85. package/dist/compliance/__tests__/view-resolution.test.js +0 -59
  86. package/dist/compliance/__tests__/views.test.d.ts +0 -1
  87. package/dist/compliance/__tests__/views.test.js +0 -59
  88. package/dist/compliance-matrix/__tests__/build.test.d.ts +0 -1
  89. package/dist/compliance-matrix/__tests__/build.test.js +0 -183
  90. package/dist/compliance-matrix/__tests__/example.test.d.ts +0 -1
  91. package/dist/compliance-matrix/__tests__/example.test.js +0 -49
  92. package/dist/confidence/__tests__/score.test.d.ts +0 -1
  93. package/dist/confidence/__tests__/score.test.js +0 -188
  94. package/dist/constraint/__tests__/example.test.d.ts +0 -1
  95. package/dist/constraint/__tests__/example.test.js +0 -14
  96. package/dist/constraint/__tests__/validate.test.d.ts +0 -1
  97. package/dist/constraint/__tests__/validate.test.js +0 -58
  98. package/dist/factor/__tests__/validate.test.d.ts +0 -1
  99. package/dist/factor/__tests__/validate.test.js +0 -112
  100. package/dist/fgca/__tests__/chain-table.test.d.ts +0 -1
  101. package/dist/fgca/__tests__/chain-table.test.js +0 -158
  102. package/dist/fgca/__tests__/layout.test.d.ts +0 -1
  103. package/dist/fgca/__tests__/layout.test.js +0 -140
  104. package/dist/fgca/__tests__/parse-canonical.test.d.ts +0 -1
  105. package/dist/fgca/__tests__/parse-canonical.test.js +0 -268
  106. package/dist/fgca/__tests__/preview-layout.test.d.ts +0 -1
  107. package/dist/fgca/__tests__/preview-layout.test.js +0 -106
  108. package/dist/fgca/__tests__/resolver.test.d.ts +0 -1
  109. package/dist/fgca/__tests__/resolver.test.js +0 -185
  110. package/dist/fgca/__tests__/validate.test.d.ts +0 -1
  111. package/dist/fgca/__tests__/validate.test.js +0 -125
  112. package/dist/goals/__tests__/GoalTreeView.test.d.ts +0 -1
  113. package/dist/goals/__tests__/GoalTreeView.test.js +0 -337
  114. package/dist/goals/__tests__/layout.test.d.ts +0 -1
  115. package/dist/goals/__tests__/layout.test.js +0 -153
  116. package/dist/goals/__tests__/mutations.test.d.ts +0 -1
  117. package/dist/goals/__tests__/mutations.test.js +0 -134
  118. package/dist/goals/__tests__/parse-canonical.test.d.ts +0 -1
  119. package/dist/goals/__tests__/parse-canonical.test.js +0 -131
  120. package/dist/goals/__tests__/validate.test.d.ts +0 -1
  121. package/dist/goals/__tests__/validate.test.js +0 -183
  122. package/dist/integration/__tests__/validate.test.d.ts +0 -1
  123. package/dist/integration/__tests__/validate.test.js +0 -169
  124. package/dist/location/__tests__/validate.test.d.ts +0 -1
  125. package/dist/location/__tests__/validate.test.js +0 -107
  126. package/dist/node/__tests__/validate.test.d.ts +0 -1
  127. package/dist/node/__tests__/validate.test.js +0 -100
  128. package/dist/process-blueprint/__tests__/compliance-lane.test.d.ts +0 -1
  129. package/dist/process-blueprint/__tests__/compliance-lane.test.js +0 -272
  130. package/dist/process-blueprint/__tests__/layout.test.d.ts +0 -1
  131. package/dist/process-blueprint/__tests__/layout.test.js +0 -196
  132. package/dist/process-blueprint/__tests__/validate.test.d.ts +0 -1
  133. package/dist/process-blueprint/__tests__/validate.test.js +0 -280
  134. package/dist/process-map/__tests__/validate.test.d.ts +0 -1
  135. package/dist/process-map/__tests__/validate.test.js +0 -199
  136. package/dist/products/__tests__/validate.test.d.ts +0 -1
  137. package/dist/products/__tests__/validate.test.js +0 -210
  138. package/dist/repo-validate/__tests__/validate-repo.test.d.ts +0 -1
  139. package/dist/repo-validate/__tests__/validate-repo.test.js +0 -576
  140. package/dist/requirement/__tests__/example.test.d.ts +0 -1
  141. package/dist/requirement/__tests__/example.test.js +0 -21
  142. package/dist/requirement/__tests__/validate.test.d.ts +0 -1
  143. package/dist/requirement/__tests__/validate.test.js +0 -80
  144. package/dist/scenarios/__tests__/validate.test.d.ts +0 -1
  145. package/dist/scenarios/__tests__/validate.test.js +0 -183
  146. package/dist/stakeholder/__tests__/validate.test.d.ts +0 -1
  147. package/dist/stakeholder/__tests__/validate.test.js +0 -88
  148. package/dist/target-state/__tests__/validate.test.d.ts +0 -1
  149. package/dist/target-state/__tests__/validate.test.js +0 -78
  150. package/dist/technology-service/__tests__/validate.test.d.ts +0 -1
  151. package/dist/technology-service/__tests__/validate.test.js +0 -121
  152. package/dist/theme/__tests__/tokens.test.d.ts +0 -1
  153. package/dist/theme/__tests__/tokens.test.js +0 -159
  154. package/dist/webview/__tests__/entity-text-layout.test.d.ts +0 -1
  155. package/dist/webview/__tests__/entity-text-layout.test.js +0 -155
  156. package/dist/webview/__tests__/entry-notations.test.d.ts +0 -1
  157. package/dist/webview/__tests__/entry-notations.test.js +0 -62
  158. package/dist/webview/__tests__/entry.test.d.ts +0 -1
  159. package/dist/webview/__tests__/entry.test.js +0 -56
  160. package/dist/webview/__tests__/render-activities.test.d.ts +0 -1
  161. package/dist/webview/__tests__/render-activities.test.js +0 -91
  162. package/dist/webview/__tests__/render-blocks.test.d.ts +0 -1
  163. package/dist/webview/__tests__/render-blocks.test.js +0 -175
  164. package/dist/webview/__tests__/render-goals.test.d.ts +0 -1
  165. package/dist/webview/__tests__/render-goals.test.js +0 -120
  166. package/dist/webview/__tests__/render-process.test.d.ts +0 -1
  167. package/dist/webview/__tests__/render-process.test.js +0 -463
  168. package/dist/webview/__tests__/render-util.test.d.ts +0 -1
  169. package/dist/webview/__tests__/render-util.test.js +0 -54
  170. package/src/__tests__/edge-path.test.ts +0 -67
  171. package/src/__tests__/node-size-presets.test.ts +0 -50
  172. package/src/__tests__/scope.test.ts +0 -27
  173. package/src/__tests__/yaml-normalize.test.ts +0 -158
  174. package/src/activities/__tests__/cpm.test.ts +0 -164
  175. package/src/activities/__tests__/gantt.test.ts +0 -290
  176. package/src/activities/__tests__/layout.test.ts +0 -112
  177. package/src/activities/__tests__/validate.test.ts +0 -446
  178. package/src/activity-card/__tests__/example.test.ts +0 -83
  179. package/src/activity-card/__tests__/layout.test.ts +0 -162
  180. package/src/activity-card/__tests__/resolver.test.ts +0 -357
  181. package/src/activity-card/__tests__/validate.test.ts +0 -167
  182. package/src/actor/__tests__/validate.test.ts +0 -114
  183. package/src/applications/__tests__/validate.test.ts +0 -256
  184. package/src/assertion/__tests__/example.test.ts +0 -37
  185. package/src/assertion/__tests__/validate.test.ts +0 -142
  186. package/src/blocks/__tests__/layout.test.ts +0 -169
  187. package/src/blocks/__tests__/validate.test.ts +0 -260
  188. package/src/business-service/__tests__/validate.test.ts +0 -160
  189. package/src/capability-map/__tests__/CapabilityMapView.test.tsx +0 -232
  190. package/src/capability-map/__tests__/address.test.ts +0 -59
  191. package/src/capability-map/__tests__/dsm-layout.test.ts +0 -52
  192. package/src/capability-map/__tests__/dsm-mutations.test.ts +0 -141
  193. package/src/capability-map/__tests__/dsm-validate.test.ts +0 -65
  194. package/src/capability-map/__tests__/validate.test.ts +0 -238
  195. package/src/change/__tests__/validate.test.ts +0 -97
  196. package/src/codex/__tests__/example.test.ts +0 -40
  197. package/src/codex/__tests__/validate.test.ts +0 -84
  198. package/src/compliance/__tests__/canon-catalog.test.ts +0 -68
  199. package/src/compliance/__tests__/classify.test.ts +0 -64
  200. package/src/compliance/__tests__/confidence.test.ts +0 -98
  201. package/src/compliance/__tests__/coverage-metric.test.ts +0 -300
  202. package/src/compliance/__tests__/demo-scenario.test.ts +0 -273
  203. package/src/compliance/__tests__/example.test.ts +0 -57
  204. package/src/compliance/__tests__/gap-report.test.ts +0 -129
  205. package/src/compliance/__tests__/html.test.ts +0 -142
  206. package/src/compliance/__tests__/impact.test.ts +0 -1060
  207. package/src/compliance/__tests__/markdown.test.ts +0 -95
  208. package/src/compliance/__tests__/trace.test.ts +0 -157
  209. package/src/compliance/__tests__/view-resolution.test.ts +0 -80
  210. package/src/compliance/__tests__/views.test.ts +0 -64
  211. package/src/compliance-matrix/__tests__/build.test.ts +0 -200
  212. package/src/compliance-matrix/__tests__/example.test.ts +0 -57
  213. package/src/confidence/__tests__/score.test.ts +0 -254
  214. package/src/constraint/__tests__/example.test.ts +0 -19
  215. package/src/constraint/__tests__/validate.test.ts +0 -68
  216. package/src/factor/__tests__/validate.test.ts +0 -133
  217. package/src/fgca/__tests__/chain-table.test.ts +0 -172
  218. package/src/fgca/__tests__/layout.test.ts +0 -179
  219. package/src/fgca/__tests__/parse-canonical.test.ts +0 -296
  220. package/src/fgca/__tests__/preview-layout.test.ts +0 -124
  221. package/src/fgca/__tests__/resolver.test.ts +0 -209
  222. package/src/fgca/__tests__/validate.test.ts +0 -142
  223. package/src/goals/__tests__/GoalTreeView.test.tsx +0 -361
  224. package/src/goals/__tests__/layout.test.ts +0 -175
  225. package/src/goals/__tests__/mutations.test.ts +0 -153
  226. package/src/goals/__tests__/parse-canonical.test.ts +0 -147
  227. package/src/goals/__tests__/validate.test.ts +0 -202
  228. package/src/integration/__tests__/validate.test.ts +0 -203
  229. package/src/location/__tests__/validate.test.ts +0 -127
  230. package/src/node/__tests__/validate.test.ts +0 -118
  231. package/src/process-blueprint/__tests__/compliance-lane.test.ts +0 -320
  232. package/src/process-blueprint/__tests__/layout.test.ts +0 -240
  233. package/src/process-blueprint/__tests__/validate.test.ts +0 -310
  234. package/src/process-map/__tests__/validate.test.ts +0 -223
  235. package/src/products/__tests__/validate.test.ts +0 -239
  236. package/src/repo-validate/__tests__/validate-repo.test.ts +0 -699
  237. package/src/requirement/__tests__/example.test.ts +0 -24
  238. package/src/requirement/__tests__/validate.test.ts +0 -96
  239. package/src/scenarios/__tests__/validate.test.ts +0 -209
  240. package/src/stakeholder/__tests__/validate.test.ts +0 -105
  241. package/src/target-state/__tests__/validate.test.ts +0 -95
  242. package/src/technology-service/__tests__/validate.test.ts +0 -143
  243. package/src/theme/__tests__/tokens.test.ts +0 -185
  244. package/src/webview/__tests__/entity-text-layout.test.ts +0 -182
  245. package/src/webview/__tests__/entry-notations.test.ts +0 -77
  246. package/src/webview/__tests__/entry.test.ts +0 -64
  247. package/src/webview/__tests__/render-activities.test.ts +0 -100
  248. package/src/webview/__tests__/render-blocks.test.ts +0 -206
  249. package/src/webview/__tests__/render-goals.test.ts +0 -128
  250. package/src/webview/__tests__/render-process.test.ts +0 -538
  251. package/src/webview/__tests__/render-util.test.ts +0 -66
@@ -1,226 +0,0 @@
1
- // Conformance test for the NorthBay Retail EU compliance demo scenario
2
- // (strategy hub #178). Validates that the demo data files load without errors,
3
- // produce the expected matrix shape, and exercise all four compliance statuses.
4
- import { describe, it, expect } from 'vitest';
5
- import { readdirSync, readFileSync } from 'node:fs';
6
- import { fileURLToPath } from 'node:url';
7
- import path from 'node:path';
8
- import yaml from 'js-yaml';
9
- import { buildComplianceIndex } from '../reverse-index.js';
10
- import { buildLawTree, buildProductView } from '../views.js';
11
- import { buildGapReport } from '../gap-report.js';
12
- import { parseImpactViewConfig, buildImpactMatrix } from '../impact.js';
13
- import { emptyCanon, ingestComplianceDoc } from '../classify.js';
14
- const EXAMPLES = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../../tests/fixtures/notation-corpus');
15
- function loadYamlDir(dir) {
16
- const full = path.join(EXAMPLES, dir);
17
- return readdirSync(full)
18
- .filter(f => f.endsWith('.yaml'))
19
- .map(f => yaml.load(readFileSync(path.join(full, f), 'utf-8')));
20
- }
21
- function loadYamlFile(relPath) {
22
- return yaml.load(readFileSync(path.join(EXAMPLES, relPath), 'utf-8'));
23
- }
24
- // ── Build the demo canon ─────────────────────────────────────────────────────
25
- const requirements = loadYamlDir('compliance/requirements').map(r => ({
26
- id: String(r.id),
27
- name: String(r.name),
28
- severity: r.severity,
29
- derived_from: Array.isArray(r.derived_from) ? r.derived_from : undefined,
30
- deadline: typeof r.deadline === 'string' ? r.deadline : undefined,
31
- }));
32
- const assertions = loadYamlDir('compliance/assertions').map(a => ({
33
- id: String(a.id),
34
- about: String(a.about),
35
- subject: String(a.subject),
36
- status: a.status,
37
- realised_via: Array.isArray(a.realised_via) ? a.realised_via : undefined,
38
- assessed_at: typeof a.assessed_at === 'string' ? a.assessed_at : undefined,
39
- next_review_at: typeof a.next_review_at === 'string' ? a.next_review_at : undefined,
40
- evidenceCount: Array.isArray(a.evidence) ? a.evidence.length : 0,
41
- }));
42
- const index = buildComplianceIndex({ requirements, assertions });
43
- // ── Demo data integrity ──────────────────────────────────────────────────────
44
- describe('demo scenario — data integrity', () => {
45
- it('loads 5 requirements from the demo scenario', () => {
46
- expect(requirements).toHaveLength(5);
47
- const ids = requirements.map(r => r.id).sort();
48
- expect(ids).toEqual([
49
- 'REQUIREMENT-GDPR-CONSENT-1',
50
- 'REQUIREMENT-GDPR-DATA-ERASURE-1',
51
- 'REQUIREMENT-GDPR-PORTABILITY-1',
52
- 'REQUIREMENT-NIS2-INCIDENT-REPORT-1',
53
- 'REQUIREMENT-NIS2-SUPPLY-CHAIN-1',
54
- ]);
55
- });
56
- it('loads 5 assertions covering all four compliance statuses', () => {
57
- expect(assertions).toHaveLength(5);
58
- const statuses = assertions.map(a => a.status).sort();
59
- expect(statuses).toContain('compliant');
60
- expect(statuses).toContain('partial');
61
- expect(statuses).toContain('non_compliant');
62
- expect(statuses).toContain('under_review');
63
- });
64
- it('requirements have deadline fields on 3 of 5', () => {
65
- const withDeadline = requirements.filter(r => r.deadline != null);
66
- expect(withDeadline).toHaveLength(3);
67
- const ids = withDeadline.map(r => r.id).sort();
68
- expect(ids).toEqual([
69
- 'REQUIREMENT-GDPR-CONSENT-1',
70
- 'REQUIREMENT-GDPR-DATA-ERASURE-1',
71
- 'REQUIREMENT-NIS2-INCIDENT-REPORT-1',
72
- ]);
73
- });
74
- it('REQUIREMENT-GDPR-DATA-ERASURE-1 has a past-due deadline', () => {
75
- const req = requirements.find(r => r.id === 'REQUIREMENT-GDPR-DATA-ERASURE-1');
76
- expect(req?.deadline).toBe('2025-12-31');
77
- // 2025-12-31 is in the past relative to any 2026+ date
78
- expect(req.deadline < '2026-01-01').toBe(true);
79
- });
80
- });
81
- // ── Single-law trees ─────────────────────────────────────────────────────────
82
- describe('single-law tree — LAW-GDPR-1', () => {
83
- const tree = buildLawTree('LAW-GDPR-1', index);
84
- it('has 3 GDPR requirements', () => {
85
- expect(tree.requirements).toHaveLength(3);
86
- const ids = tree.requirements.map(r => r.requirement.id).sort();
87
- expect(ids).toEqual([
88
- 'REQUIREMENT-GDPR-CONSENT-1',
89
- 'REQUIREMENT-GDPR-DATA-ERASURE-1',
90
- 'REQUIREMENT-GDPR-PORTABILITY-1',
91
- ]);
92
- });
93
- it('erasure requirement has 2 assertions (one per product)', () => {
94
- const erasure = tree.requirements.find(r => r.requirement.id === 'REQUIREMENT-GDPR-DATA-ERASURE-1');
95
- expect(erasure).toBeDefined();
96
- expect(erasure.assertions).toHaveLength(2);
97
- const statuses = erasure.assertions.map(a => a.status).sort();
98
- expect(statuses).toEqual(['compliant', 'non_compliant']);
99
- });
100
- it('consent requirement has exactly one partial assertion', () => {
101
- const consent = tree.requirements.find(r => r.requirement.id === 'REQUIREMENT-GDPR-CONSENT-1');
102
- expect(consent.assertions).toHaveLength(1);
103
- expect(consent.assertions[0].status).toBe('partial');
104
- });
105
- it('portability requirement is compliant', () => {
106
- const portability = tree.requirements.find(r => r.requirement.id === 'REQUIREMENT-GDPR-PORTABILITY-1');
107
- expect(portability.assertions).toHaveLength(1);
108
- expect(portability.assertions[0].status).toBe('compliant');
109
- });
110
- });
111
- describe('single-law tree — LAW-NIS2-1', () => {
112
- const tree = buildLawTree('LAW-NIS2-1', index);
113
- it('has 2 NIS2 requirements', () => {
114
- expect(tree.requirements).toHaveLength(2);
115
- const ids = tree.requirements.map(r => r.requirement.id).sort();
116
- expect(ids).toEqual([
117
- 'REQUIREMENT-NIS2-INCIDENT-REPORT-1',
118
- 'REQUIREMENT-NIS2-SUPPLY-CHAIN-1',
119
- ]);
120
- });
121
- it('incident-report requirement has one under_review assertion', () => {
122
- const incident = tree.requirements.find(r => r.requirement.id === 'REQUIREMENT-NIS2-INCIDENT-REPORT-1');
123
- expect(incident.assertions).toHaveLength(1);
124
- expect(incident.assertions[0].status).toBe('under_review');
125
- });
126
- it('supply-chain requirement has no assertions — deliberate gap', () => {
127
- const supplyChain = tree.requirements.find(r => r.requirement.id === 'REQUIREMENT-NIS2-SUPPLY-CHAIN-1');
128
- expect(supplyChain.assertions).toHaveLength(0);
129
- });
130
- });
131
- // ── Single-product views ─────────────────────────────────────────────────────
132
- describe('single-product view — PRODUCT-ECOMM-1', () => {
133
- const view = buildProductView('PRODUCT-ECOMM-1', index);
134
- it('covers 4 requirements (4 assertions with PRODUCT-ECOMM-1 as subject)', () => {
135
- expect(view.requirements).toHaveLength(4);
136
- });
137
- it('includes non_compliant erasure status', () => {
138
- const erasure = view.requirements.find(r => r.requirement.id === 'REQUIREMENT-GDPR-DATA-ERASURE-1');
139
- expect(erasure).toBeDefined();
140
- expect(erasure.assertion.status).toBe('non_compliant');
141
- });
142
- });
143
- describe('single-product view — PRODUCT-SUPPORT-1', () => {
144
- const view = buildProductView('PRODUCT-SUPPORT-1', index);
145
- it('has exactly 1 assertion (erasure only)', () => {
146
- expect(view.requirements).toHaveLength(1);
147
- expect(view.requirements[0].requirement.id).toBe('REQUIREMENT-GDPR-DATA-ERASURE-1');
148
- expect(view.requirements[0].assertion.status).toBe('compliant');
149
- });
150
- });
151
- // ── Gap report ───────────────────────────────────────────────────────────────
152
- describe('gap report', () => {
153
- const today = '2026-06-10';
154
- const report = buildGapReport(index, { today });
155
- it('NIS2 supply-chain requirement appears in requirements-without-assertions', () => {
156
- const gap = report.requirementsWithoutAssertions.find(r => r.id === 'REQUIREMENT-NIS2-SUPPLY-CHAIN-1');
157
- expect(gap).toBeDefined();
158
- });
159
- it('non_compliant erasure requirement is NOT in requirements-without-assertions', () => {
160
- const gap = report.requirementsWithoutAssertions.find(r => r.id === 'REQUIREMENT-GDPR-DATA-ERASURE-1');
161
- expect(gap).toBeUndefined();
162
- });
163
- it('erasure requirement is NOT in pastDeadlineRequirements — it has a compliant assertion for PRODUCT-SUPPORT-1', () => {
164
- // buildGapReport only surfaces a past-deadline req when ALL its assertions
165
- // are non-compliant. PRODUCT-SUPPORT-1 has a compliant assertion for erasure,
166
- // so the requirement is excluded from the past-deadline gap list even though
167
- // PRODUCT-ECOMM-1 is non_compliant.
168
- const overdue = report.pastDeadlineRequirements.find(r => r.id === 'REQUIREMENT-GDPR-DATA-ERASURE-1');
169
- expect(overdue).toBeUndefined();
170
- });
171
- });
172
- // ── Compliance-impact view-config ────────────────────────────────────────────
173
- describe('compliance-impact view-config — gdpr-nis2', () => {
174
- const raw = loadYamlFile('compliance-impact/gdpr-nis2.compliance-impact.view.yaml');
175
- const result = parseImpactViewConfig(raw);
176
- it('parses without errors', () => {
177
- expect(result.ok).toBe(true);
178
- });
179
- it('scopes to PRODUCT-ECOMM-1 and PRODUCT-SUPPORT-1', () => {
180
- if (!result.ok)
181
- throw new Error('parse failed');
182
- expect(result.config.subjects.products).toEqual(['PRODUCT-ECOMM-1', 'PRODUCT-SUPPORT-1']);
183
- });
184
- it('filters obligations to LAW-GDPR-1 and LAW-NIS2-1', () => {
185
- if (!result.ok)
186
- throw new Error('parse failed');
187
- expect(result.config.obligations.filter?.derived_from_codex).toEqual(['LAW-GDPR-1', 'LAW-NIS2-1']);
188
- });
189
- it('builds a matrix with 2 products and 5 requirements scoped to the two laws', () => {
190
- if (!result.ok)
191
- throw new Error('parse failed');
192
- // Build the canon using ingestComplianceDoc (same path as the Studio extension).
193
- const canon = emptyCanon();
194
- for (const r of loadYamlDir('compliance/requirements'))
195
- ingestComplianceDoc(canon, r);
196
- for (const a of loadYamlDir('compliance/assertions'))
197
- ingestComplianceDoc(canon, a);
198
- // Add the two products.
199
- canon.products.push({ id: 'PRODUCT-ECOMM-1', name: 'E-Commerce Platform' });
200
- canon.products.push({ id: 'PRODUCT-SUPPORT-1', name: 'Customer Support Service' });
201
- const matrix = buildImpactMatrix(canon, result.config);
202
- expect(matrix.columns).toHaveLength(2);
203
- // 5 requirements are split: 3 GDPR + 2 NIS2 — all 5 should appear.
204
- expect(matrix.rows).toHaveLength(5);
205
- });
206
- });
207
- // ── Regression: existing worked examples unaffected ─────────────────────────
208
- describe('regression — existing tests/fixtures/notation-corpus/requirement + tests/fixtures/notation-corpus/assertion unchanged', () => {
209
- const reqs = loadYamlDir('requirement').map(r => ({
210
- id: String(r.id),
211
- name: String(r.name),
212
- derived_from: Array.isArray(r.derived_from) ? r.derived_from : undefined,
213
- }));
214
- const asns = loadYamlDir('assertion').map(a => ({
215
- id: String(a.id),
216
- about: String(a.about),
217
- subject: String(a.subject),
218
- status: a.status,
219
- }));
220
- const idx = buildComplianceIndex({ requirements: reqs, assertions: asns });
221
- it('original LAW-PERSONAL-DATA-2017-1 tree still resolves correctly', () => {
222
- const tree = buildLawTree('LAW-PERSONAL-DATA-2017-1', idx);
223
- expect(tree.requirements.map(r => r.requirement.id)).toEqual(['REQUIREMENT-DATA-ERASURE-1']);
224
- expect(tree.requirements[0].assertions).toHaveLength(3);
225
- });
226
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,51 +0,0 @@
1
- // Conformance — single-law tree + single-product view on the acme_corp worked
2
- // examples (mirrored under tests/fixtures/notation-corpus/requirement, tests/fixtures/notation-corpus/assertion). Pins the
3
- // #84 Phase 3 acceptance.
4
- import { describe, it, expect } from 'vitest';
5
- import { readdirSync, readFileSync } from 'node:fs';
6
- import { fileURLToPath } from 'node:url';
7
- import path from 'node:path';
8
- import yaml from 'js-yaml';
9
- import { buildComplianceIndex } from '../reverse-index.js';
10
- import { buildLawTree, buildProductView } from '../views.js';
11
- const examples = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../../tests/fixtures/notation-corpus');
12
- function loadAll(dir) {
13
- const full = path.join(examples, dir);
14
- return readdirSync(full).filter(f => f.endsWith('.yaml')).map(f => yaml.load(readFileSync(path.join(full, f), 'utf-8')));
15
- }
16
- const requirements = loadAll('requirement').map(r => ({
17
- id: String(r.id), name: String(r.name),
18
- severity: r.severity,
19
- derived_from: Array.isArray(r.derived_from) ? r.derived_from : undefined,
20
- }));
21
- const assertions = loadAll('assertion').map(a => ({
22
- id: String(a.id), about: String(a.about), subject: String(a.subject),
23
- status: a.status,
24
- evidenceCount: Array.isArray(a.evidence) ? a.evidence.length : 0,
25
- }));
26
- const index = buildComplianceIndex({ requirements, assertions });
27
- describe('single-law tree — LAW-PERSONAL-DATA-2017-1', () => {
28
- const tree = buildLawTree('LAW-PERSONAL-DATA-2017-1', index);
29
- it('derives the data-erasure requirement with its three assertions', () => {
30
- expect(tree.requirements.map(r => r.requirement.id)).toEqual(['REQUIREMENT-DATA-ERASURE-1']);
31
- const node = tree.requirements[0];
32
- expect(node.assertions.map(a => a.id)).toEqual([
33
- 'ASSERTION-CRM-DATA-ERASURE-1',
34
- 'ASSERTION-MOBILE-DATA-ERASURE-1',
35
- 'ASSERTION-ONBOARD-DATA-ERASURE-1',
36
- ]);
37
- expect(node.assertions.map(a => a.status).sort()).toEqual(['compliant', 'partial', 'under_review']);
38
- });
39
- it('the internal-only audit-log requirement is not under any law', () => {
40
- expect(index.requirementsByLaw.has('LAW-PERSONAL-DATA-2017-1')).toBe(true);
41
- expect(tree.requirements.some(r => r.requirement.id === 'REQUIREMENT-AUDIT-LOG-RETENTION-1')).toBe(false);
42
- });
43
- });
44
- describe('single-product view — PRODUCT-MOBILE-1', () => {
45
- it('shows the data-erasure requirement as compliant', () => {
46
- const view = buildProductView('PRODUCT-MOBILE-1', index);
47
- expect(view.requirements.map(r => r.requirement.id)).toEqual(['REQUIREMENT-DATA-ERASURE-1']);
48
- expect(view.requirements[0].assertion.status).toBe('compliant');
49
- expect(view.requirements[0].requirement.name).toBe('Personal-data erasure on request within 30 days');
50
- });
51
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,113 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { readdirSync, readFileSync } from 'node:fs';
3
- import { fileURLToPath } from 'node:url';
4
- import path from 'node:path';
5
- import yaml from 'js-yaml';
6
- import { buildComplianceIndex } from '../reverse-index.js';
7
- import { buildGapReport } from '../gap-report.js';
8
- const input = {
9
- requirements: [
10
- { id: 'REQUIREMENT-A-1', name: 'A', severity: 'high' }, // has assertions
11
- { id: 'REQUIREMENT-B-1', name: 'B', severity: 'low' }, // orphan
12
- { id: 'REQUIREMENT-C-1', name: 'C', severity: 'medium' }, // orphan
13
- { id: 'REQUIREMENT-D-1', name: 'D' }, // orphan, no severity
14
- ],
15
- assertions: [
16
- { id: 'ASSERTION-1', about: 'REQUIREMENT-A-1', subject: 'PRODUCT-1', status: 'compliant', evidenceCount: 0 }, // 007
17
- { id: 'ASSERTION-2', about: 'REQUIREMENT-A-1', subject: 'PRODUCT-2', status: 'under_review', evidenceCount: 0 }, // NOT 007
18
- { id: 'ASSERTION-3', about: 'REQUIREMENT-A-1', subject: 'PRODUCT-3', status: 'partial', evidenceCount: 2, next_review_at: '2025-01-01' }, // stale
19
- ],
20
- };
21
- describe('buildGapReport', () => {
22
- const index = buildComplianceIndex(input);
23
- const report = buildGapReport(index, { today: '2026-06-02' });
24
- it('lists requirements without assertions, severity-sorted (high→medium→low→none)', () => {
25
- expect(report.requirementsWithoutAssertions.map(r => r.id)).toEqual([
26
- 'REQUIREMENT-C-1', // medium
27
- 'REQUIREMENT-B-1', // low
28
- 'REQUIREMENT-D-1', // none
29
- ]);
30
- });
31
- it('flags only compliant/partial assertions with empty evidence (ASSERT-007)', () => {
32
- expect(report.assertionsWithoutEvidence.map(a => a.id)).toEqual(['ASSERTION-1']);
33
- // under_review with empty evidence is legitimate — not flagged.
34
- expect(report.assertionsWithoutEvidence.map(a => a.id)).not.toContain('ASSERTION-2');
35
- });
36
- it('flags assertions whose next_review_at is past today (ASSERT-008)', () => {
37
- expect(report.staleAssertions.map(a => a.id)).toEqual(['ASSERTION-3']);
38
- });
39
- it('produces no stale list when today is not supplied (clock-free)', () => {
40
- expect(buildGapReport(index, {}).staleAssertions).toEqual([]);
41
- });
42
- });
43
- // ── Conformance on the acme_corp worked examples ────────────────────────────
44
- const examples = path.resolve(path.dirname(fileURLToPath(import.meta.url)), '../../../../../tests/fixtures/notation-corpus');
45
- function loadAll(dir) {
46
- const full = path.join(examples, dir);
47
- return readdirSync(full).filter(f => f.endsWith('.yaml')).map(f => yaml.load(readFileSync(path.join(full, f), 'utf-8')));
48
- }
49
- describe('gap report — acme_corp worked examples', () => {
50
- const requirements = loadAll('requirement').map(r => ({
51
- id: String(r.id), name: String(r.name), severity: r.severity,
52
- derived_from: Array.isArray(r.derived_from) ? r.derived_from : undefined,
53
- }));
54
- const assertions = loadAll('assertion').map(a => ({
55
- id: String(a.id), about: String(a.about), subject: String(a.subject),
56
- status: a.status,
57
- next_review_at: a.next_review_at,
58
- evidenceCount: Array.isArray(a.evidence) ? a.evidence.length : 0,
59
- }));
60
- const report = buildGapReport(buildComplianceIndex({ requirements, assertions }), { today: '2026-06-02' });
61
- it('surfaces the internal audit-log requirement as an un-asserted gap', () => {
62
- expect(report.requirementsWithoutAssertions.map(r => r.id)).toEqual(['REQUIREMENT-AUDIT-LOG-RETENTION-1']);
63
- });
64
- it('does not flag the under_review empty-evidence assertion under ASSERT-007', () => {
65
- expect(report.assertionsWithoutEvidence).toEqual([]);
66
- });
67
- it('has no stale assertions (all acme reviews are in the future)', () => {
68
- expect(report.staleAssertions).toEqual([]);
69
- });
70
- });
71
- describe('CV-5 -- pastDeadlineRequirements', () => {
72
- it('lists requirements with past deadline and no compliant assertion', () => {
73
- const indexLocal = buildComplianceIndex({
74
- requirements: [
75
- { id: 'REQ-PD-1', name: 'Past deadline, no assertion', deadline: '2020-01-01' },
76
- { id: 'REQ-PD-2', name: 'Past deadline, non-compliant assertion', deadline: '2020-01-01' },
77
- { id: 'REQ-PD-3', name: 'Past deadline, compliant assertion', deadline: '2020-01-01' },
78
- { id: 'REQ-FU-1', name: 'Future deadline', deadline: '2099-01-01' },
79
- { id: 'REQ-ND-1', name: 'No deadline' },
80
- ],
81
- assertions: [
82
- { id: 'ASS-2', about: 'REQ-PD-2', subject: 'S', status: 'non_compliant' },
83
- { id: 'ASS-3', about: 'REQ-PD-3', subject: 'S', status: 'compliant' },
84
- ],
85
- });
86
- const r = buildGapReport(indexLocal, { today: '2026-06-09' });
87
- // REQ-PD-1 and REQ-PD-2 are past-deadline without full compliance
88
- expect(r.pastDeadlineRequirements.map(x => x.id)).toEqual(['REQ-PD-1', 'REQ-PD-2']);
89
- // REQ-PD-3 has a compliant assertion -> excluded
90
- expect(r.pastDeadlineRequirements.map(x => x.id)).not.toContain('REQ-PD-3');
91
- // Future or no deadline -> excluded
92
- expect(r.pastDeadlineRequirements.map(x => x.id)).not.toContain('REQ-FU-1');
93
- expect(r.pastDeadlineRequirements.map(x => x.id)).not.toContain('REQ-ND-1');
94
- });
95
- it('is empty when no today is supplied (clock-free)', () => {
96
- const idx2 = buildComplianceIndex({
97
- requirements: [{ id: 'REQ-PD-1', name: 'Past', deadline: '2020-01-01' }],
98
- assertions: [],
99
- });
100
- expect(buildGapReport(idx2, {}).pastDeadlineRequirements).toEqual([]);
101
- });
102
- it('sorts oldest deadline first', () => {
103
- const idx3 = buildComplianceIndex({
104
- requirements: [
105
- { id: 'REQ-A', name: 'A', deadline: '2022-06-01' },
106
- { id: 'REQ-B', name: 'B', deadline: '2019-01-01' },
107
- ],
108
- assertions: [],
109
- });
110
- const r3 = buildGapReport(idx3, { today: '2026-06-09' });
111
- expect(r3.pastDeadlineRequirements.map(x => x.id)).toEqual(['REQ-B', 'REQ-A']);
112
- });
113
- });
@@ -1 +0,0 @@
1
- export {};
@@ -1,122 +0,0 @@
1
- import { describe, it, expect } from 'vitest';
2
- import { renderComplianceHtml } from '../html.js';
3
- import { emptyCanon, ingestComplianceDoc } from '../classify.js';
4
- function synthetic() {
5
- const canon = emptyCanon();
6
- ingestComplianceDoc(canon, { notation: 'product', id: 'PRODUCT-M-1', name: 'Mobile App' });
7
- ingestComplianceDoc(canon, { notation: 'requirement', id: 'REQUIREMENT-ERASURE-1', name: 'Erasure', severity: 'high', derived_from: ['LAW-X-1'] });
8
- ingestComplianceDoc(canon, { notation: 'requirement', id: 'REQUIREMENT-LOG-1', name: 'Logs', severity: 'low' });
9
- ingestComplianceDoc(canon, {
10
- notation: 'assertion',
11
- id: 'ASSERTION-1',
12
- about: 'REQUIREMENT-ERASURE-1',
13
- subject: 'PRODUCT-M-1',
14
- status: 'compliant',
15
- evidence: [{ kind: 'note', text: 'x' }],
16
- next_review_at: '2026-09-01',
17
- });
18
- ingestComplianceDoc(canon, { id: 'LAW-X-1', name: 'Privacy Law', zone: 'codex', type: 'LAW' });
19
- return canon;
20
- }
21
- describe('renderComplianceHtml — document shell', () => {
22
- it('produces a complete HTML document with branded header and stamp', () => {
23
- const html = renderComplianceHtml(synthetic(), { mode: 'matrix' }, { today: '2026-06-03' });
24
- expect(html.startsWith('<!doctype html>')).toBe(true);
25
- expect(html).toContain('<title>Compliance Matrix</title>');
26
- expect(html).toContain('<div class="cmp-eyebrow">Transitrix · Compliance</div>');
27
- expect(html).toContain('<h1>Compliance Matrix</h1>');
28
- expect(html).toContain('Generated 2026-06-03');
29
- expect(html).toContain('@page');
30
- expect(html).toContain('size: A4 portrait');
31
- });
32
- it('escapes HTML in product and requirement names', () => {
33
- const canon = emptyCanon();
34
- ingestComplianceDoc(canon, { notation: 'product', id: 'PRODUCT-X-1', name: '<Mobile> & "Web"' });
35
- ingestComplianceDoc(canon, { notation: 'requirement', id: 'REQUIREMENT-X-1', name: 'A & B' });
36
- const html = renderComplianceHtml(canon, { mode: 'matrix' });
37
- expect(html).not.toMatch(/<Mobile>/);
38
- expect(html).toContain('&lt;Mobile&gt; &amp; &quot;Web&quot;');
39
- expect(html).toContain('A &amp; B');
40
- });
41
- });
42
- describe('renderComplianceHtml — matrix', () => {
43
- it('renders a table with status badges and gap cells', () => {
44
- const html = renderComplianceHtml(synthetic(), { mode: 'matrix' });
45
- expect(html).toContain('<table class="cmp-matrix">');
46
- expect(html).toContain('<th>Erasure</th>');
47
- expect(html).toContain('<th>Logs</th>');
48
- expect(html).toContain('<span class="cmp-badge cmp-compliant">Compliant</span>');
49
- expect(html).toMatch(/cmp-cell-gap/);
50
- expect(html).toContain('1 products × 2 requirements');
51
- });
52
- it('shows an empty-state message when nothing was scanned', () => {
53
- const html = renderComplianceHtml(emptyCanon(), { mode: 'matrix' });
54
- expect(html).toContain('No products or requirements found');
55
- });
56
- });
57
- describe('renderComplianceHtml — law', () => {
58
- it('renders the law name, requirement block, and assertion bullet with badge', () => {
59
- const html = renderComplianceHtml(synthetic(), { mode: 'law', id: 'LAW-X-1' });
60
- expect(html).toContain('<h1>Compliance — Privacy Law</h1>');
61
- expect(html).toContain('class="cmp-req-name">Erasure');
62
- expect(html).toContain('class="cmp-req-id">REQUIREMENT-ERASURE-1');
63
- expect(html).toContain('cmp-sev cmp-sev-high');
64
- expect(html).toContain('cmp-badge cmp-compliant');
65
- expect(html).toContain('review by 2026-09-01');
66
- });
67
- it('handles an unknown law id with an empty-state message', () => {
68
- const html = renderComplianceHtml(synthetic(), { mode: 'law', id: 'LAW-NONE' });
69
- expect(html).toContain('<h1>Compliance — LAW-NONE</h1>');
70
- expect(html).toContain('No requirements derive from');
71
- });
72
- });
73
- describe('renderComplianceHtml — product', () => {
74
- it('renders the product table of asserted requirements', () => {
75
- const html = renderComplianceHtml(synthetic(), { mode: 'product', id: 'PRODUCT-M-1' });
76
- expect(html).toContain('<h1>Compliance — Mobile App</h1>');
77
- expect(html).toContain('<th>Requirement</th>');
78
- expect(html).toContain('<th>Status</th>');
79
- expect(html).toContain('cmp-badge cmp-compliant');
80
- expect(html).toContain('2026-09-01');
81
- });
82
- });
83
- describe('renderComplianceHtml — gap', () => {
84
- it('lists the un-asserted requirement and shows ✓ none for clean sections', () => {
85
- const html = renderComplianceHtml(synthetic(), { mode: 'gap' }, { today: '2026-06-02' });
86
- expect(html).toContain('Requirements without assertions');
87
- expect(html).toContain('REQUIREMENT-LOG-1');
88
- expect(html).toContain('severity low');
89
- expect(html).toContain('Assertions without evidence — ASSERT-007');
90
- expect(html).toContain('Stale assertions — ASSERT-008');
91
- expect(html).toContain('class="cmp-ok">✓ none');
92
- });
93
- it('counts gaps in the summary line', () => {
94
- const html = renderComplianceHtml(synthetic(), { mode: 'gap' });
95
- expect(html).toMatch(/1 gap\(s\)/);
96
- });
97
- });
98
- // ── CV-6: renderImpactMatrixHtml ─────────────────────────────────────────────
99
- import { renderImpactMatrixHtml } from '../html.js';
100
- import { buildImpactMatrix } from '../impact.js';
101
- describe('renderImpactMatrixHtml (CV-6)', () => {
102
- it('returns a complete HTML document with matrix title and table', () => {
103
- const canon = emptyCanon();
104
- ingestComplianceDoc(canon, { notation: 'product', id: 'PROD-1', name: 'Product One' });
105
- ingestComplianceDoc(canon, { notation: 'requirement', id: 'REQ-1', name: 'Req One', severity: 'high' });
106
- ingestComplianceDoc(canon, { notation: 'assertion', id: 'ASS-1', about: 'REQ-1', subject: 'PROD-1', status: 'compliant' });
107
- const matrix = buildImpactMatrix({ products: canon.products, requirements: canon.requirements, assertions: canon.assertions, codex: canon.codex, subjects: canon.subjects }, { id: 'VIEW-1', name: 'My View', subjects: { products: ['PROD-1'] }, obligations: {} });
108
- const html = renderImpactMatrixHtml(matrix, { today: '2026-06-09' });
109
- expect(html).toContain('<table>');
110
- expect(html).toContain('My View');
111
- expect(html).toContain('VIEW-1');
112
- expect(html).toContain('OK');
113
- });
114
- it('renders gap cells with no_obligation_label text', () => {
115
- const canon = emptyCanon();
116
- ingestComplianceDoc(canon, { notation: 'product', id: 'PROD-1', name: 'P1' });
117
- ingestComplianceDoc(canon, { notation: 'requirement', id: 'REQ-1', name: 'R1' });
118
- const matrix = buildImpactMatrix({ products: canon.products, requirements: canon.requirements, assertions: canon.assertions, codex: canon.codex, subjects: canon.subjects }, { id: 'V2', name: 'V2', subjects: { products: ['PROD-1'] }, obligations: {} });
119
- const html = renderImpactMatrixHtml(matrix);
120
- expect(html).toContain('No mapped obligation');
121
- });
122
- });
@@ -1 +0,0 @@
1
- export {};