Commit 1d5b0b6
committed
Add unit tests for dataset, revision and task services (#686)
Brings the three under-covered services up to the testing-initiative
target:
- dataset.ts: 50% -> 99.6% statements
- revision.ts: 31% -> 93.5% statements
- task.ts: 14% -> 100% statements
Covers happy and unhappy paths across each service's public methods,
including task lifecycle and status transitions, revision draft/approval
flows and dataset fact-table replacement.
dataset.ts: drop the dead revisionIndex === 1 guard around the
dimension/measure reset (the surrounding code already guarantees only
the first revision reaches it) and use the injected this.fileService
instead of getFileService() so the draft-revision delete path is
unit-testable.
Raise the global coverage thresholds in jest.config.ts to match the new
floor (statements 79, branches 67, functions 75, lines 79).1 parent b02c6cb commit 1d5b0b6
5 files changed
Lines changed: 1609 additions & 11 deletions
File tree
- src/services
- test/unit/services
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
25 | 25 | | |
26 | 26 | | |
27 | 27 | | |
28 | | - | |
29 | | - | |
30 | | - | |
31 | | - | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
45 | 45 | | |
46 | 46 | | |
47 | 47 | | |
48 | | - | |
49 | 48 | | |
50 | 49 | | |
51 | 50 | | |
| |||
118 | 117 | | |
119 | 118 | | |
120 | 119 | | |
121 | | - | |
122 | | - | |
123 | | - | |
124 | | - | |
| 120 | + | |
| 121 | + | |
| 122 | + | |
125 | 123 | | |
126 | 124 | | |
127 | 125 | | |
| |||
356 | 354 | | |
357 | 355 | | |
358 | 356 | | |
359 | | - | |
360 | 357 | | |
361 | 358 | | |
362 | 359 | | |
363 | 360 | | |
364 | 361 | | |
365 | | - | |
| 362 | + | |
366 | 363 | | |
367 | 364 | | |
368 | 365 | | |
| |||
0 commit comments