Skip to content

Commit b3b58b6

Browse files
committed
test(plugin-grid): numeric-string order values discriminate number from text order
Claude-Session: https://claude.ai/code/session_01Baqv5mDLFH63hvh9G4YGn5 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 02167ad commit b3b58b6

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

‎ui/packages/plugin-grid/src/__tests__/groupOrderBy-25858.test.tsx‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -238,12 +238,13 @@ describe('client-grouped: each group\'s order value is folded from its rows (obj
238238
});
239239

240240
it('a numeric order value arriving as a numeric string orders as the number', () => {
241+
// As text the values read '12' < '3.10' < '3.9', and the labels read a, b, c.
241242
const rows = [
242-
{ id: 1, bucket: 'a', amount: '3.10' },
243+
{ id: 1, bucket: 'c', amount: '3.10' },
243244
{ id: 2, bucket: 'b', amount: '3.9' },
244-
{ id: 3, bucket: 'c', amount: '12' },
245+
{ id: 3, bucket: 'a', amount: '12' },
245246
];
246-
expect(groupLabelsOf({ fields: [{ field: 'bucket', orderBy: 'amount' }] }, rows)).toEqual(['a', 'b', 'c']);
247+
expect(groupLabelsOf({ fields: [{ field: 'bucket', orderBy: 'amount' }] }, rows)).toEqual(['c', 'b', 'a']);
247248
});
248249

249250
it('CONTROL — no `orderBy`: label order, exactly as before', () => {

0 commit comments

Comments
 (0)