Repository navigation
test(data): cover the null and undefined x the same guard un-breaks - #5281
Conversation
The guard in apexcharts#5279 was written for an invalid Date, but the line it replaced threw on anything without .replace(). null and undefined go through the same path, and a gap in a data set is spelt null far more often than a Date is built from garbage: without the guard, [{x: 1}, {x: null}, {x: 3}] renders nothing at all. Three assertions, all red when the guard is reverted: isValidDate answers false instead of throwing, the points either side of the gap keep their x, and the render survives an undefined x. Co-Authored-By: Claude Opus 5 <[email protected]>
|
Checked this the same way: 8 passing as it stands, and 5 failing with 3 passing once I take the guard back out, which is what you reported. The three new ones are earning their place, and the suite numbers match on the nose (136 files, 3257 tests). You are right that One thing to be aware of rather than change: Nothing blocking. |
|
Agreed on the leftover, and I measured what it does downstream today rather than leave it as a note. A scratch spec rendering So the raw And yes, |
Follow-up to #5279, tests only, no
src/change.You pointed out that the guard there also un-breaks
nullandundefinedx values, and that it was the one thing in the PR with no test on it. You were right on both counts, and it is the more common case: a gap in a data set is speltnullfar more often than aDateis built from garbage.Reverting the guard on this branch, all three new assertions go red:
Tests 5 failed | 3 passed (8)with the guard reverted,8 passedwith it in place. The 5 are the 2 from #5279 plus these 3, so neither set is vacuous.What the render does, measured rather than assumed. Without the guard,
[{x: 1}, {x: null}, {x: 3}]gives 0.apexcharts-linepaths and 0 x axis labels. With it, 1 path and labels1, 2, 3.Full unit suite: 136 files, 3257 tests, 0 failures.
npm run lintclean.npm run typecheckstill 23 errors, all pre-existing inDrilldown.js.prettier --writeon the spec touched only one block this PR adds, and that reformat is included.