Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 15 additions & 0 deletions src/selectors/__tests__/dataSelectorsTest.js
Original file line number Diff line number Diff line change
Expand Up @@ -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({
Expand Down
18 changes: 18 additions & 0 deletions stories/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,24 @@ storiesOf('Griddle main', module)
</div>
)
})
.add('with many-column data', () => {
type Griddle = new () => GenericGriddle<any>;
const Griddle = GenericGriddle as Griddle;
return (
<div>
<small>
Default columns should be in order.
</small>
<Griddle
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', '10-10': '10' }
]}
plugins={[plugins.LocalPlugin]}
/>
</div>
);
})
.add('with many columns', () => {
return (
<div>
Expand Down