Skip to content

Commit d6d4d02

Browse files
committed
test(plugin-kanban): flip the 9043 title-routed row and fix case-folded warn fixtures
Row 4c reached the declared `toString` lane through the retired title key; it now reaches it through the case-folded id lookup and asserts the title-valued record is an orphan. The 10069 warn fixtures used a value that case-folds onto a lane id, so they now use one that matches no lane. Co-Authored-By: Claude <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01877XiBYSaRCk2CU7cMSg3S
1 parent 10f7c88 commit d6d4d02

2 files changed

Lines changed: 21 additions & 11 deletions

File tree

‎packages/plugin-kanban/src/__tests__/laneIdOnly-10069.test.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -95,33 +95,33 @@ describe('objectui#10069 — lane membership is decided by lane id only', () =>
9595

9696
it('names the raw value, the grouping field and every available lane id', () => {
9797
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
98-
bucket(LANES, [{ id: 'r1', status: 'Open' }]);
98+
bucket(LANES, [{ id: 'r1', status: 'Opened' }]);
9999

100100
expect(warn).toHaveBeenCalledTimes(1);
101101
const message = String(warn.mock.calls[0][0]);
102-
expect(message).toContain('"Open"');
102+
expect(message).toContain('"Opened"');
103103
expect(message).toContain('"status"');
104104
expect(message).toContain('["open", "won"]');
105105
});
106106

107107
it('fires ONCE per distinct raw value per pass, not once per record', () => {
108108
const warn = vi.spyOn(console, 'warn').mockImplementation(() => {});
109109
bucket(LANES, [
110-
{ id: 'r1', status: 'Open' },
111-
{ id: 'r2', status: 'Open' },
112-
{ id: 'r3', status: 'Open' },
110+
{ id: 'r1', status: 'Opened' },
111+
{ id: 'r2', status: 'Opened' },
112+
{ id: 'r3', status: 'Opened' },
113113
{ id: 'r4', status: 'Closed Won' },
114-
{ id: 'r5', status: 'open' }, // matched: no warn
114+
{ id: 'r5', status: 'OPEN' }, // matched (case-folded id): no warn
115115
]);
116116

117117
expect(warn).toHaveBeenCalledTimes(2);
118118
const messages = warn.mock.calls.map((c) => String(c[0]));
119-
expect(messages.find((m) => m.includes('"Open"'))).toContain('3 record(s)');
119+
expect(messages.find((m) => m.includes('"Opened"'))).toContain('3 record(s)');
120120
expect(messages.find((m) => m.includes('"Closed Won"'))).toContain('1 record(s)');
121121

122122
// A second pass (the next render or data load) warns again: deduplication
123123
// is per pass, never module-wide, so a later board is not silenced.
124-
bucket(LANES, [{ id: 'r1', status: 'Open' }]);
124+
bucket(LANES, [{ id: 'r1', status: 'Opened' }]);
125125
expect(warn).toHaveBeenCalledTimes(3);
126126
});
127127

‎packages/plugin-kanban/src/__tests__/prototypeGroupKeys-9043.test.ts‎

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,10 @@ describe('bucketCardsIntoColumns — prototype member names as group values (obj
107107
expect(oneRecord('a')).toBe('a:r1');
108108
});
109109

110-
it('row 1c — CONTROL: an ordinary value matching a lane LABEL still maps to its id', () => {
110+
it('row 1c — CONTROL: an ordinary value matching a lane id in another CASE still maps to its id', () => {
111+
// Lane `{ id: 'a', title: 'A' }`: 'A' reaches it through the case-folded id
112+
// lookup. It used to be readable as a TITLE match too; objectui#10069
113+
// retired title matching, and this row holds because of the folding alone.
111114
expect(oneRecord('A')).toBe('a:r1');
112115
});
113116

@@ -137,10 +140,17 @@ describe('bucketCardsIntoColumns — prototype member names as group values (obj
137140
);
138141
});
139142

140-
it('row 4c — DECLARED LANE `toString` receives a record that reached it by LABEL', () => {
141-
expect(oneRecord('Done', [{ id: 'toString', title: 'Done' }, { id: 'a', title: 'A' }])).toBe(
143+
it('row 4c — DECLARED LANE `toString` receives a record that reached it through the FOLDED lookup', () => {
144+
// The lookup's stored VALUE is the prototype member name. This row used to
145+
// reach it by the lane's TITLE ('Done'); objectui#10069 retired title
146+
// matching, so it now reaches it by a case variant of the id, and the
147+
// title-valued record is asserted to be an orphan beside it.
148+
expect(oneRecord('TOSTRING', [{ id: 'toString', title: 'Done' }, { id: 'a', title: 'A' }])).toBe(
142149
'toString:r1, a:',
143150
);
151+
expect(oneRecord('Done', [{ id: 'toString', title: 'Done' }, { id: 'a', title: 'A' }])).toBe(
152+
`toString:, a:, ${KANBAN_UNCOLUMNED_ID}:r1`,
153+
);
144154
});
145155

146156
it('row 5 — every prototype member name is bucketed exactly once, never dropped', () => {

0 commit comments

Comments
 (0)