Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
34 changes: 1 addition & 33 deletions README.md
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
3 changes: 3 additions & 0 deletions __jest__/stub.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
const stub = {};

export default stub;
61 changes: 61 additions & 0 deletions __tests__/components/forecast-summary.test.jsx
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((
Copy link
Author

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 beforeEach hooks with enzyme. In this case it would stop you having to shallow render the same component over and over again.

<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"

Copy link
Author

Choose a reason for hiding this comment

The 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');
});
13 changes: 13 additions & 0 deletions __tests__/components/location-details.test.jsx
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');
});
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<html>
<head>
<meta charset="UTF-8">
<title>React App</title>
<title>Weather App</title>
<link rel="shortcut icon" type="image/x-icon" href="favicon.ico" />
</head>
<body>
Expand Down
Loading