This repository has been archived by the owner on Feb 18, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 49
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(sidebar): make items sortable by drag n drop
- Loading branch information
1 parent
b396ec5
commit 3913c32
Showing
9 changed files
with
176 additions
and
57 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 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 |
---|---|---|
@@ -0,0 +1,43 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import sinon from 'sinon'; | ||
import { expect } from 'chai'; | ||
|
||
import { TOGGLE_SIDEBAR_ITEM_POSITION } from './App/types'; | ||
import SidebarContainer from './Sidebar'; | ||
|
||
describe('containers/Sidebar', () => { | ||
const defaultProps = { | ||
location: {} | ||
}; | ||
let store; | ||
|
||
beforeEach(() => { | ||
store = { | ||
dispatch: sinon.spy(), | ||
getState: () => ({ | ||
accounts: [], | ||
settings: { | ||
hideSidebar: false | ||
} | ||
}), | ||
subscribe: () => null | ||
}; | ||
}); | ||
|
||
it('should dispatch TOGGLE_SIDEBAR_ITEM_POSITION upon onChangePosition', () => { | ||
const wrapper = shallow(<SidebarContainer {...defaultProps} />, { | ||
context: { store } | ||
}); | ||
|
||
const from = 12; | ||
const to = 15; | ||
wrapper.props().onChangePosition({ from, to }); | ||
|
||
expect(store.dispatch).to.have.been.calledWith({ | ||
type: TOGGLE_SIDEBAR_ITEM_POSITION, | ||
from, | ||
to | ||
}); | ||
}); | ||
}); |
Oops, something went wrong.