-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Drawer redesign for 2.0. Changes: - changed the active state styling - colors are now theme based, not fixed - theme based roundness - removed the "color" prop - it can be now controller with the primaryColor (see [the expo app example](https://github.com/callstack/react-native-paper/pull/377/files#diff-cf8d6e3323746c5c486de08cb0c333c3R59)) - added snapshot tests <img width="248" alt="screen shot 2018-05-16 at 23 59 54" src="https://user-images.githubusercontent.com/7827311/40146708-e58bf92c-5966-11e8-8916-e76cb42e2f86.png"> <img width="248" alt="screen shot 2018-05-17 at 00 00 02" src="https://user-images.githubusercontent.com/7827311/40146727-f26662a4-5966-11e8-9cee-dc01e3cd5599.png"> Fixes #358. Snapshot tests added. Run `yarn test`.
- Loading branch information
Showing
4 changed files
with
347 additions
and
45 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
/* @flow */ | ||
|
||
import * as React from 'react'; | ||
import renderer from 'react-test-renderer'; | ||
import DrawerItem from '../DrawerItem'; | ||
|
||
it('renders basic DrawerItem', () => { | ||
const tree = renderer | ||
.create(<DrawerItem onPress={() => {}} label="Example item" />) | ||
.toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders DrawerItem with icon', () => { | ||
const tree = renderer | ||
.create(<DrawerItem icon="info" label="Example item" />) | ||
.toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); | ||
|
||
it('renders active DrawerItem', () => { | ||
const tree = renderer | ||
.create(<DrawerItem icon="info" active label="Example item" />) | ||
.toJSON(); | ||
|
||
expect(tree).toMatchSnapshot(); | ||
}); |
Oops, something went wrong.