diff --git a/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx b/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx index 3d48b37..b26c6b2 100644 --- a/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx +++ b/src/routes/Dashboard/components/ForecastTile/ForecastTile.jsx @@ -38,7 +38,11 @@ export class ForecastTile extends React.PureComponent { componentDidUpdate = () => { this.getWeatherForecast(); } + + // TOOD: Use redux getWeatherForecast = () => { + if (!this.props.token) return; + if (this.props.address && !this.props.address.weather) { const address = this.props.address; api.getWeatherObservations(this.props.token, address.longitude, address.latitude) diff --git a/src/routes/Dashboard/components/ForecastTile/ForecastTile.test.js b/src/routes/Dashboard/components/ForecastTile/ForecastTile.test.js index afd4a44..26e943c 100644 --- a/src/routes/Dashboard/components/ForecastTile/ForecastTile.test.js +++ b/src/routes/Dashboard/components/ForecastTile/ForecastTile.test.js @@ -20,7 +20,6 @@ const setup = () => { return { spies, props, component }; }; -test.todo('write tests for ForecastTile once complete.'); test('(Component) Renders with expected elements', t => { const { component } = setup();