-
Notifications
You must be signed in to change notification settings - Fork 380
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(react-grid): support custom grouping processing #395
Conversation
], | ||
}]; | ||
const getHierarchicalChildGroups = groups => groups | ||
.map(group => ({ key: String(group.key), value: group.key, nestedData: group.items })); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we extract duplicated code? I mean something like this:
const createGetChildGroupsMock = (groups) => {
const getHierarchicalChildGroups = groups => groups
.map(group => ({ key: String(group.key), value: group.key, nestedData: group.items }));
return jest.fn(getHierarchicalChildGroups);
};
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't like decreasing tests readability as it will not reduce loc count dramatically.
import { mount } from 'enzyme'; | ||
import Demo from './local-grouping-static'; | ||
|
||
describe('BS3: grouping with custom', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The test suite name sounds strange
data: [{ | ||
key: 'Male', | ||
items: generateRows({ | ||
columnValues: { ...defaultColumnValues, sex: ['Female'] }, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this sex: ['Female']
correct for Male
group?
No description provided.