-
Notifications
You must be signed in to change notification settings - Fork 374
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(react-scheduler): set Scheduler's height to Root instead of body (#…
…2189) BREAKING CHANGE: `DayView` plugin's, `WeekView` plugin's and `MonthView` plugin's layout component now doesn't have the `height` property. `height` is now `Scheduler` plugin's root component property. ```diff ... <DayView layoutComponent={({ - height, ...restProps }) => ( <DayView.Layout - height={height} {...restProps} /> )} /> ... <WeekView layoutComponent={({ - height, ...restProps }) => ( <WeekView.Layout - height={height} {...restProps} /> )} /> ... <MonthView layoutComponent={({ - height, ...restProps }) => ( <MonthView.Layout - height={height} {...restProps} /> )} /> ... <Scheduler rootComponent={({ + height, ...restProps }) => ( <Scheduler.Root + height={height} {...restProps} /> )} /> ... ```
- Loading branch information
1 parent
47666b7
commit 46bef67
Showing
22 changed files
with
130 additions
and
138 deletions.
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
40 changes: 40 additions & 0 deletions
40
packages/dx-react-scheduler-material-ui/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,40 @@ | ||
import * as React from 'react'; | ||
import { createShallow } from '@material-ui/core/test-utils'; | ||
import { Root } from './layout'; | ||
|
||
describe('Root layout', () => { | ||
const defaultProps = { | ||
height: 300, | ||
}; | ||
let shallow; | ||
beforeAll(() => { | ||
shallow = createShallow({ dive: true }); | ||
}); | ||
|
||
it('should pass rest props to the root element', () => { | ||
const tree = shallow(( | ||
<Root {...defaultProps} data={{ a: 1 }} /> | ||
)); | ||
|
||
expect(tree.prop('data')) | ||
.toMatchObject({ a: 1 }); | ||
}); | ||
|
||
it('should pass style to the root element', () => { | ||
const tree = shallow(( | ||
<Root {...defaultProps} style={{ a: 1 }} /> | ||
)); | ||
|
||
expect(tree.prop('style')) | ||
.toMatchObject({ height: '300px', a: 1 }); | ||
}); | ||
|
||
it('should replace style of the root element', () => { | ||
const tree = shallow(( | ||
<Root {...defaultProps} style={{ height: 1 }} /> | ||
)); | ||
|
||
expect(tree.prop('style')) | ||
.toMatchObject({ height: 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
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
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
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.