-
Notifications
You must be signed in to change notification settings - Fork 26
Code-Review #5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
ian-antking
wants to merge
14
commits into
CommandShiftHQ:master
Choose a base branch
from
Barbarjinks:master
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Code-Review #5
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
2703cff
first commit
Barbarjinks d2e5566
added test to the file
Barbarjinks 2d1fa11
added forecast summary & test
Barbarjinks f9ae708
fixed basic errors, data showing
Barbarjinks a0ec862
added some css
Barbarjinks 246d595
added icons and date
Barbarjinks 8bba3d4
adding forecast details component
Barbarjinks 2ddc3fd
state
Barbarjinks eed3bc8
changed props - added parenthesis
Barbarjinks 82b4c1c
added api
Barbarjinks 12476c4
added search function
Barbarjinks 25350c3
cleaned up basic visuals
Barbarjinks aaa8223
edited
Barbarjinks 16429c2
Update README.md
Barbarjinks File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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,33 +1 @@ | ||
| # React Bootstrap | ||
|
|
||
| React boilerplate project for Manchester Codes' projects. | ||
|
|
||
| ## Getting Started | ||
|
|
||
| ### Clone down this repository (replace `<your_project_name>`: | ||
|
|
||
| ```bash | ||
| git clone git@github.com:MCRcodes/react-bootstrap.git <your_project_name> | ||
| ``` | ||
|
|
||
| ### Install dependencies | ||
|
|
||
| ```bash | ||
| npm install | ||
| ``` | ||
|
|
||
| ### Start up the application: | ||
|
|
||
| ```bash | ||
| npm start | ||
| ``` | ||
|
|
||
| ### Visit `localhost:8080` in your browser. | ||
|
|
||
| You should see a **Hello World** message. | ||
|
|
||
| ### Change the rendered output | ||
|
|
||
| You can change what is mounted to the DOM in `src/index.jsx`. | ||
|
|
||
| It might be a good idea to make an `App` component inside `App.jsx` (will likely handle your layout and routing), and to mount this to the DOM. | ||
| React Weather App |
This file contains hidden or 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,3 @@ | ||
| const stub = {}; | ||
|
|
||
| export default stub; |
This file contains hidden or 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,61 @@ | ||
| import React from 'react'; | ||
| import { shallow } from 'enzyme'; | ||
| import ForecastSummary from '../../src/components/forecast-summary'; | ||
|
|
||
| it('renders the date', () => { | ||
| const wrapper = shallow(( | ||
| <ForecastSummary | ||
| date="mockDate" | ||
| temperature="mockTemperature" | ||
| description="mockDescription" | ||
| icon="mockIcon" | ||
| /> | ||
|
|
||
| )); | ||
|
|
||
| expect(wrapper.find('.forecast-summary__date').text()).toEqual('mockDate'); | ||
| }); | ||
|
|
||
| it('renders the temperature', () => { | ||
| const wrapper = shallow(( | ||
| <ForecastSummary | ||
| date="mockDate" | ||
| temperature="mockTemperature" | ||
| description="mockDescription" | ||
| icon="mockIcon" | ||
| /> | ||
| )); | ||
| expect(wrapper.find('.forecast-summary__temperature').text()).toEqual('mockTemperature'); | ||
| }); | ||
| it('renders the description', () => { | ||
| const wrapper = shallow(( | ||
| <ForecastSummary | ||
| date="mockDate" | ||
| temperature="mockTemperature" | ||
| description="mockDescription" | ||
| icon="mockIcon" | ||
| /> | ||
| )); | ||
|
|
||
| expect(wrapper.find('.forecast-summary__description').text()).toEqual('mockDescription'); | ||
| }); | ||
|
|
||
| it('renders the icon', () => { | ||
| const wrapper = shallow(( | ||
|
|
||
| <ForecastSummary | ||
|
|
||
| date="mockDate" | ||
|
|
||
| temperature="mockTemperature" | ||
|
|
||
|
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Some odd line spacing here... |
||
| description="mockDescription" | ||
|
|
||
| icon="mockIcon" | ||
|
|
||
| /> | ||
|
|
||
| )); | ||
|
|
||
| expect(wrapper.find('.forecast-summary__icon').text()).toEqual('mockIcon'); | ||
| }); | ||
This file contains hidden or 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,13 @@ | ||
| import React from 'react'; | ||
| import Enzyme from 'enzyme'; | ||
| import LocationDetails from '../../src/components/location-details'; | ||
|
|
||
| it('renders the passed city and country in a h1 tag', () => { | ||
| const wrapper = Enzyme.shallow(( | ||
| <LocationDetails city="foo" country="bar" /> | ||
| )); | ||
|
|
||
| const text = wrapper.find('h1').text(); | ||
|
|
||
| expect(text).toEqual('foo, bar'); | ||
| }); |
This file contains hidden or 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.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You can still use the
beforeEachhooks with enzyme. In this case it would stop you having to shallow render the same component over and over again.