-
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): add components for the Grid plugin #553
Merged
MaximKudriavtsev
merged 8 commits into
DevExpress:master
from
MaximKudriavtsev:Extract-Grid-components
Dec 7, 2017
Merged
Changes from 5 commits
Commits
Show all changes
8 commits
Select commit
Hold shift + click to select a range
287e18e
refactor(react-grid): add components for the Grid plugin
MaximKudriavtsev 449f74e
Add bs3 components and docs
MaximKudriavtsev c940209
Add MUI components
MaximKudriavtsev 7e6fb0e
Fix after review
MaximKudriavtsev 504da8b
Fix after review
MaximKudriavtsev 56b5caa
Extract only root component from the Grid plugin
MaximKudriavtsev b1993d3
Add empty row to Grid.md
MaximKudriavtsev b42872c
Merge branch 'master' into Extract-Grid-components
MaximKudriavtsev File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
104 changes: 104 additions & 0 deletions
104
packages/dx-react-grid-bootstrap3/src/templates/layout.test.jsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,104 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { Root, Header, Footer } from './layout'; | ||
|
||
describe('Layout', () => { | ||
const children = <div />; | ||
|
||
describe('Root', () => { | ||
it('should pass className to the root element', () => { | ||
const tree = shallow(( | ||
<Root className="custom-class" /> | ||
)); | ||
|
||
expect(tree.is('.custom-class')) | ||
.toBeTruthy(); | ||
expect(tree.is('.panel-default')) | ||
.toBeTruthy(); | ||
}); | ||
|
||
it('should pass rest props to the root element', () => { | ||
const tree = shallow(( | ||
<Root data={{ a: 1 }} /> | ||
)); | ||
|
||
expect(tree.props().data) | ||
.toMatchObject({ a: 1 }); | ||
}); | ||
}); | ||
|
||
describe('Header', () => { | ||
it('should pass className to the root element', () => { | ||
const tree = shallow(( | ||
<Header | ||
className="custom-class" | ||
data={{ a: 1 }} | ||
> | ||
{children} | ||
</Header> | ||
)); | ||
|
||
expect(tree.is('.custom-class')) | ||
.toBeTruthy(); | ||
expect(tree.is('.panel-heading')) | ||
.toBeTruthy(); | ||
}); | ||
|
||
it('should combine style on the root element', () => { | ||
const tree = shallow(( | ||
<Header | ||
style={{ color: 'red' }} | ||
> | ||
{children} | ||
</Header> | ||
)); | ||
|
||
expect(tree.props().style) | ||
.toMatchObject({ paddingBottom: '5px', color: 'red' }); | ||
}); | ||
|
||
it('should pass rest props to the root element', () => { | ||
const tree = shallow(( | ||
<Header | ||
data={{ a: 1 }} | ||
> | ||
{children} | ||
</Header> | ||
)); | ||
|
||
expect(tree.props().data) | ||
.toMatchObject({ a: 1 }); | ||
}); | ||
}); | ||
|
||
describe('Footer', () => { | ||
it('should pass className to the root element', () => { | ||
const tree = shallow(( | ||
<Footer | ||
data={{ a: 1 }} | ||
className="custom-class" | ||
> | ||
{children} | ||
</Footer> | ||
)); | ||
|
||
expect(tree.is('.custom-class')) | ||
.toBeTruthy(); | ||
expect(tree.is('.panel-footer')) | ||
.toBeTruthy(); | ||
}); | ||
|
||
it('should pass rest props to the root element', () => { | ||
const tree = shallow(( | ||
<Footer | ||
data={{ a: 1 }} | ||
> | ||
{children} | ||
</Footer> | ||
)); | ||
|
||
expect(tree.props().data) | ||
.toMatchObject({ a: 1 }); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Why
!!
?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.
@SergeyAlexeev Because if don't pass children to the FooterPlaceholder my application broken with an exception.