Skip to content

Commit 71680ec

Browse files
committed
test(lint): the report export liveness pin turns into a silence pin at the flip
Claude-Session: https://claude.ai/code/session_01JQwxbYfDeaywgrS5N1PZfg Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3b4d4d0 commit 71680ec

1 file changed

Lines changed: 17 additions & 7 deletions

File tree

‎packages/lint/src/lint-liveness-properties.test.ts‎

Lines changed: 17 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2294,23 +2294,33 @@ describe('#26146 — ledger rows below the child level are graded and counted',
22942294
// ── #26548: a report's period and export are declared before the renderer reads them ──
22952295
//
22962296
// `report` joined TYPE_COLLECTIONS with its ledger's first warned rows:
2297-
// `dateRange` and `exportOptions` are `planned` + `authorWarn` until the
2298-
// Console report page reads them. Read off the SHIPPED ledger, so the flip to
2299-
// `live` (which drops `authorWarn`) turns the warning half of this block red
2300-
// on purpose — rewrite it as a silence pin in that same edit.
2301-
describe('report period and export (#26548 — planned until the report renderer reads them)', () => {
2297+
// `dateRange` and `exportOptions` shipped `planned` + `authorWarn` until the
2298+
// Console report page read them. `exportOptions` is `live` since #25873's
2299+
// export slice (the report page draws its Export control), so its warning pin
2300+
// turned red at that flip ON PURPOSE and is re-subjected to the silence.
2301+
// `dateRange` is still `planned` here and is authored in the SAME call: one
2302+
// ledger load, one warning, so the silence is a reading and not a lint that
2303+
// stopped loading ledgers (which also answers []).
2304+
describe('report period and export (#26548 — exportOptions live, dateRange planned until the renderer reads it)', () => {
23022305
const report = (extra: Record<string, unknown> = {}) => ({
23032306
reports: [{ name: 'pipeline', label: 'Pipeline', type: 'summary', dataset: 'sales', rows: ['stage'], values: ['revenue'], ...extra }],
23042307
});
23052308

2306-
it('warns on each key, at the report, with the row\'s author hint', () => {
2309+
it('warns on dateRange only, at the report, with the row\'s author hint; exportOptions is silent', () => {
23072310
const findings = lintLivenessProperties(report({ dateRange: { dimension: 'close_date' }, exportOptions: { formats: ['csv'] } }));
23082311
const planned = findings.filter((f) => f.rule === 'liveness-planned-property');
2309-
expect(planned.map((f) => f.message.match(/`(dateRange|exportOptions)`/)?.[1]).sort()).toEqual(['dateRange', 'exportOptions']);
2312+
expect(planned.map((f) => f.message.match(/`(dateRange|exportOptions)`/)?.[1]).sort()).toEqual(['dateRange']);
23102313
for (const f of planned) {
23112314
expect(f.where).toContain("report 'pipeline'");
23122315
expect(f.hint).toMatch(/^Keep it, but nothing reads it yet: the Console report page draws no /);
23132316
}
2317+
expect(findings.filter((f) => /`exportOptions`/.test(f.message))).toEqual([]);
2318+
const row = JSON.parse(readFileSync(join(shippedLedgerDir(), 'report.json'), 'utf8')).props.exportOptions;
2319+
// Anti-vacuity: the row is the shape this silence pin exists for.
2320+
expect(row.status).toBe('live');
2321+
expect(row).not.toHaveProperty('authorWarn');
2322+
expect(row).not.toHaveProperty('authorHint');
2323+
expect(row.evidence).toContain('ui/packages/plugin-report/src/ReportExport.tsx#ReportExportControl');
23142324
});
23152325

23162326
it('CONTROL — a report declaring neither key draws no warning', () => {

0 commit comments

Comments
 (0)