-
Notifications
You must be signed in to change notification settings - Fork 2
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 #64 from Auctionable-Change/nav-bar-testing
Nav bar testing
- Loading branch information
Showing
8 changed files
with
253 additions
and
6 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 |
---|---|---|
|
@@ -8,7 +8,7 @@ npm-debug.* | |
*.mobileprovision | ||
*.orig.* | ||
web-build/ | ||
coverage | ||
coverage/**/* | ||
|
||
# macOS | ||
.DS_Store |
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,31 @@ | ||
import NavBar from "./NavBar"; | ||
import React from "react"; | ||
import renderer from "react-test-renderer"; | ||
|
||
|
||
describe("NavBar", () => { | ||
it("should render three icons component", () => { | ||
const tree = renderer.create(<NavBar />).toJSON(); | ||
expect(tree.children.length).toBe(3); | ||
}); | ||
it("renders correctly", () => { | ||
const tree = renderer.create(<NavBar />).toJSON(); | ||
expect(tree).toMatchSnapshot(); | ||
}); | ||
it("should render a search icon first", () => { | ||
const tree = renderer.create(<NavBar />).toJSON(); | ||
const searchIconId = tree.children[0].children[0].children[0].props.id; | ||
expect(searchIconId).toBe("search"); | ||
}); | ||
it("should render a plus icon second", () => { | ||
const tree = renderer.create(<NavBar />).toJSON(); | ||
const addIconId = tree.children[1].children[0].children[0].props.id; | ||
expect(addIconId).toBe("add"); | ||
}); | ||
it("should render a profile icon third", () => { | ||
const tree = renderer.create(<NavBar />).toJSON(); | ||
const addIconId = tree.children[2].children[0].children[0].props.id; | ||
expect(addIconId).toBe("profile"); | ||
}); | ||
|
||
}); |
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,116 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`NavBar renders correctly 1`] = ` | ||
<View | ||
style={ | ||
Object { | ||
"backgroundColor": "white", | ||
"bottom": "0%", | ||
"display": "flex", | ||
"flexDirection": "row", | ||
"height": "11%", | ||
"justifyContent": "space-around", | ||
"padding": 10, | ||
"position": "absolute", | ||
"width": "100%", | ||
} | ||
} | ||
> | ||
<RNGestureHandlerButton | ||
collapsable={false} | ||
onGestureEvent={[Function]} | ||
onGestureHandlerEvent={[Function]} | ||
onGestureHandlerStateChange={[Function]} | ||
onHandlerStateChange={[Function]} | ||
rippleColor={0} | ||
style={ | ||
Array [ | ||
Object { | ||
"overflow": "hidden", | ||
}, | ||
undefined, | ||
] | ||
} | ||
> | ||
<View | ||
accessible={true} | ||
> | ||
<Image | ||
accessibilityRole="button" | ||
id="search" | ||
source={1} | ||
style={ | ||
Object { | ||
"height": 45, | ||
"width": 45, | ||
} | ||
} | ||
/> | ||
</View> | ||
</RNGestureHandlerButton> | ||
<RNGestureHandlerButton | ||
collapsable={false} | ||
onGestureEvent={[Function]} | ||
onGestureHandlerEvent={[Function]} | ||
onGestureHandlerStateChange={[Function]} | ||
onHandlerStateChange={[Function]} | ||
rippleColor={0} | ||
style={ | ||
Array [ | ||
Object { | ||
"overflow": "hidden", | ||
}, | ||
undefined, | ||
] | ||
} | ||
> | ||
<View | ||
accessible={true} | ||
> | ||
<Image | ||
accessibilityRole="button" | ||
id="add" | ||
source={1} | ||
style={ | ||
Object { | ||
"height": 45, | ||
"width": 45, | ||
} | ||
} | ||
/> | ||
</View> | ||
</RNGestureHandlerButton> | ||
<RNGestureHandlerButton | ||
collapsable={false} | ||
onGestureEvent={[Function]} | ||
onGestureHandlerEvent={[Function]} | ||
onGestureHandlerStateChange={[Function]} | ||
onHandlerStateChange={[Function]} | ||
rippleColor={0} | ||
style={ | ||
Array [ | ||
Object { | ||
"overflow": "hidden", | ||
}, | ||
undefined, | ||
] | ||
} | ||
> | ||
<View | ||
accessible={true} | ||
> | ||
<Image | ||
accessibilityRole="button" | ||
id="profile" | ||
source={1} | ||
style={ | ||
Object { | ||
"height": 45, | ||
"width": 45, | ||
} | ||
} | ||
/> | ||
</View> | ||
</RNGestureHandlerButton> | ||
</View> | ||
`; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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