From 48d200dab88cfe2c314bff5572d238b6c7235250 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Tue, 3 Apr 2018 15:14:03 -0500 Subject: [PATCH 1/2] Add story to prove #804 --- stories/index.tsx | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) diff --git a/stories/index.tsx b/stories/index.tsx index 05b8b844..a26c7541 100644 --- a/stories/index.tsx +++ b/stories/index.tsx @@ -684,6 +684,24 @@ storiesOf('Griddle main', module) ) }) + .add('with many-column data', () => { + type Griddle = new () => GenericGriddle; + const Griddle = GenericGriddle as Griddle; + return ( +
+ + Default columns should be in order. + + +
+ ); + }) .add('with many columns', () => { return (
From b5e70822b4f7bb5ca61fde75fb69dc4d8edd78d4 Mon Sep 17 00:00:00 2001 From: Keith Dahlby Date: Wed, 4 Apr 2018 11:25:07 -0500 Subject: [PATCH 2/2] Real repro with failing test --- src/selectors/__tests__/dataSelectorsTest.js | 15 +++++++++++++++ stories/index.tsx | 4 ++-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/src/selectors/__tests__/dataSelectorsTest.js b/src/selectors/__tests__/dataSelectorsTest.js index 82e07e9e..250dd75e 100644 --- a/src/selectors/__tests__/dataSelectorsTest.js +++ b/src/selectors/__tests__/dataSelectorsTest.js @@ -280,6 +280,21 @@ test('it gets columnTitles in the correct order', test => { test.deepEqual(selectors.columnTitlesSelector(state), ['Two', 'One']); }); +test('it gets many columnTitles in the correct order', test => { + const state = new Immutable.fromJS({ + data: [ + { '00-00': '0', '01-01': '1', '02-02': '2', '03-03': '3', '04-04': '4', + '05-05': '5', '06-06': '6', '07-07': '7', '08-08': '8', '09-09': '9' } + ], + renderProperties: {} + }); + + test.deepEqual(selectors.columnTitlesSelector(state), [ + '00-00', '01-01', '02-02', '03-03', '04-04', + '05-05', '06-06', '07-07', '08-08', '09-09', + ]); +}); + [undefined, null].map(data => test(`visibleRowIds is empty if data is ${data}`, (assert) => { const state = new Immutable.fromJS({ diff --git a/stories/index.tsx b/stories/index.tsx index a26c7541..19a3937d 100644 --- a/stories/index.tsx +++ b/stories/index.tsx @@ -694,8 +694,8 @@ storiesOf('Griddle main', module)