Skip to content
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

Merged
merged 23 commits into from
Oct 24, 2017
Merged

feat(react-grid): support custom grouping processing #395

merged 23 commits into from
Oct 24, 2017

Conversation

kvet
Copy link
Contributor

@kvet kvet commented Oct 11, 2017

No description provided.

],
}];
const getHierarchicalChildGroups = groups => groups
.map(group => ({ key: String(group.key), value: group.key, nestedData: group.items }));
Copy link
Contributor

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);
};

Copy link
Contributor Author

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', () => {
Copy link
Contributor

@SergeyAlexeev SergeyAlexeev Oct 12, 2017

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'] },
Copy link
Contributor

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?

@kvet kvet requested review from gsobolev and dxbykov October 13, 2017 07:18
@kvet kvet requested a review from viterobk October 16, 2017 11:37
@kvet kvet merged commit 4fb92d0 into DevExpress:master Oct 24, 2017
@kvet kvet deleted the custom-grouping branch October 24, 2017 13:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants