Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #82 from bencripps/feature/remove-store
Remove `store` from props declaration -- will be pulled from context
- Loading branch information
Showing
44 changed files
with
344 additions
and
342 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,3 @@ | ||
webpack/ | ||
demo/ | ||
dist/ | ||
test/ |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -33,8 +33,7 @@ const config = { | |
pageSize, | ||
plugins, | ||
events, | ||
stateKey, | ||
store: Store | ||
stateKey | ||
}; | ||
|
||
export default ( | ||
|
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,54 +1,30 @@ | ||
import expect from 'expect'; | ||
import { OrderedMap } from 'immutable'; | ||
|
||
import { | ||
SORT_METHODS, SORT_DIRECTIONS | ||
} from './../../../src/constants/GridConstants'; | ||
import { mockStore, getColumnManager } from './../../testUtils/index'; | ||
import { initializedStore, getColumnManager } from './../../testUtils'; | ||
|
||
import { | ||
gridColumns, | ||
gridActions, | ||
localGridData, | ||
defaultColumnManager | ||
} from './../../testUtils/data'; | ||
|
||
const props = { | ||
columnManager: defaultColumnManager, | ||
columns: gridColumns, | ||
store: mockStore({}, ...gridActions), | ||
store: initializedStore, | ||
data: localGridData, | ||
editorState: new OrderedMap(); | ||
editorState: new OrderedMap() | ||
}; | ||
|
||
props.store.subscribe = () => {}; | ||
|
||
describe('A ColumnManager', () => { | ||
|
||
const manager = getColumnManager(); | ||
const store = manager.store; | ||
/* eslint-disable no-unused-vars */ | ||
const manager = getColumnManager(props); | ||
|
||
it('Should sort locally', () => { | ||
|
||
expect(store.dispatch).toExist(); | ||
|
||
manager.doSort({ | ||
method: SORT_METHODS.LOCAL, | ||
column: gridColumns[0], | ||
direction: SORT_DIRECTIONS.DESCEND, | ||
dataSource: { data: localGridData }, | ||
stateKey: '__sorter__' | ||
}); | ||
|
||
const after = store.getActions(); | ||
|
||
expect(after).toEqual([{ | ||
data: [ | ||
{ name: 'Charles Barkley', position: 'Power Forward', _key: 'row-1' }, | ||
{ name: 'Michael Jordan', position: 'Shooting Guard', _key: 'row-0' } | ||
], | ||
stateKey: '__sorter__', | ||
type: '@@react-redux-grid/SORT_DATA' | ||
}]); | ||
expect(initializedStore.dispatch).toExist(); | ||
|
||
}); | ||
|
||
}); |
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.