-
Notifications
You must be signed in to change notification settings - Fork 2.2k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
RDG Tree Cell Expand Styling Issues. (#1316)
* Fix cell actions exmaple. * Fix styling issues for cell expansion and childrow indents. * fix minor styling issue * fix test * remove f describe * address comments * address comments
- Loading branch information
1 parent
a1ef518
commit edab134
Showing
6 changed files
with
93 additions
and
179 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
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 was deleted.
Oops, something went wrong.
38 changes: 38 additions & 0 deletions
38
packages/react-data-grid/src/__tests__/CellExpander.spec.js
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,38 @@ | ||
import React from 'react'; | ||
import { mount } from 'enzyme'; | ||
|
||
import CellExpander from '../CellExpander'; | ||
import { CellExpand } from 'common/constants'; | ||
|
||
const setup = (overrideExpandableOptions = {}) => { | ||
const props = { | ||
expandableOptions: { | ||
expanded: true, | ||
...overrideExpandableOptions | ||
}, | ||
onCellExpand: jasmine.createSpy() | ||
}; | ||
|
||
return { | ||
props, | ||
wrapper: mount(<CellExpander {...props} />) | ||
}; | ||
}; | ||
|
||
describe('CellExpand', () => { | ||
it('should create an instance of CellExpand', () => { | ||
const { wrapper } = setup({ expanded: false }); | ||
|
||
expect(wrapper.find('.rdg-cell-expand').length).toBe(1); | ||
expect(wrapper.find('span').text()).toBe(CellExpand.RIGHT_TRIANGLE); | ||
}); | ||
|
||
it('should call onCellExpand when clicked', () => { | ||
const { wrapper, props } = setup({ expanded: false }); | ||
|
||
wrapper.find('span').simulate('click'); | ||
|
||
expect(props.onCellExpand.calls.count()).toEqual(1); | ||
expect(wrapper.find('span').text()).toBe(CellExpand.DOWN_TRIANGLE); | ||
}); | ||
}); |
Oops, something went wrong.