Uh oh!
There was an error while loading. Please reload this page.
fix(plugin-gantt): type-check its tests (#4040 tranche 1) - #4283
Merged
Conversation
…#4040) `packages/plugin-gantt` gains a `tsconfig.test.json` on the objectui#3032 template, chained from its `type-check` script, so all 41 test files are compiled. All three declared code-tier errors were real. `GanttView.scales.test.tsx` had hand-written copies of `MS_PER_DAY` and `NOMINAL_DAYS` — both exported by `GanttView.tsx` — under a header claiming it uses "the same" mapping as the component; the copy had already drifted (`NOMINAL_DAYS` grew a `year` entry the fork never did), which is exactly what TS2741 reported. Both are imported now. `GanttView.summaryedit.test.tsx` stubbed `onTaskUpdate` with a bare `vi.fn()`, so `mock.calls` typed as arrays of unknown length next to assertions that read the second argument; the spies now carry the handler's signature. Co-Authored-By: Claude Fable 5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_017Qqyix2QcnpUC9XeYVDzx3
The latest updates on your projects. Learn more about Vercel for GitHub. |
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
yinlianghui
marked this pull request as ready for review
August 11, 2026 11:22
github-merge-queueBot
removed this pull request from the merge queue due to a conflict with the base branch
Aug 11, 2026
…#4274, gantt removal is this PR's)
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
github-merge-queueBot
removed this pull request from the merge queue due to a conflict with the base branch
Aug 11, 2026
…vals kept, this PR's removal kept)
github-merge-queueBot
removed this pull request from the merge queue due to a conflict with the base branch
Aug 11, 2026
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
…emovals landed, gantt removal is this PR's)
Contributor
✅ Console Performance Budget
📦 Bundle Size Report
Size Limits
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Part of #4040 — tranche 1, package 4 of 5. One package per PR, per the 裁决 on objectstack-ai/objectstack#4118 (PM, 2026-08-03):
Measured before / after
TEST_DEBT436681e72)Before:
1.
TS2741was a hand-forked copy of a constant the component exports — already driftedGanttView.scales.test.tsxdeclared its ownMS_PER_DAYandNOMINAL_DAYS. Both areexported from
GanttView.tsx(:205,:214), and the file's own header says itrecomputes expectations "with the same linear ms→px mapping the component uses". It was a
hand copy, so "the same" was a claim rather than a fact — and it had already stopped being
true:
NOMINAL_DAYSgrew ayearentry whenGanttViewModedid, and the fork neverfollowed. Nothing noticed, because nothing compiled the file. This is the fork shape
objectui#3009 found in
spec-derived-unions.test.ts, one package over.Both constants are imported now, which is also why the fix is an import and not a
year: 365.25added to the copy: the copy is the defect.The trade-off, stated rather than buried. Importing couples the expectation to the
implementation's value, so a deliberate change to
NOMINAL_DAYS.monthnow moves both sidesand these cases stay green. That is the right coupling for what they assert — they pin that
bar widths, gridlines and drag steps all follow one mapping, not that the mapping is
30.44— and the proof below shows the cases still discriminate a rendering bug. A testthat wants to pin the constant's value should say so in one line rather than by forking it.
2. A spy that declared it takes no arguments, next to assertions reading its second
onTaskUpdatewas stubbed with a barevi.fn(), which typesmock.callsasany[][]—arrays of unknown length. The cases destructure
[t]and readcall[1](the changespayload). Typing the spy with the handler signature the file's own
renderViewhelperalready declares makes
mock.callsa real[task, changes]tuple and removes the twoinline annotations that were fighting the untyped spy.
Discrimination proof
The imported constants raise a fair question — can these cases still fail? Perturbing the
component's rendering mapping by 25% (
pxPerDayatGanttView.tsx:879) while leavingNOMINAL_DAYSalone:Six of the file's eight cases go red. Restored immediately; the probe is not in the diff.
The type project's own discrimination is the three errors quoted at the top: before this
branch
tscread none of these 41 files.Verification
TEST_DEBTshrinks by exactly this package's line; no other entry is touched.Generated by Claude Code