Skip to content

Commit

Permalink
🔀Merge pull request #144 from alexlee-dev/feature/rename-planets
Browse files Browse the repository at this point in the history
✏️ Rename Planets
  • Loading branch information
Alex Lee committed Sep 22, 2019
2 parents 7ab1100 + 12ca3ba commit d08ba55
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

import { setMockState, mockState } from '../fixtures/default'

describe('Planets', () => {
describe('Map', () => {
beforeEach(() => {
setMockState()
cy.visit('/')
cy.contains('Planets').click()
cy.contains('Map').click()
})

it('Should display planets.', () => {
Expand Down
4 changes: 2 additions & 2 deletions src/constants.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import MarketView from './views/market'
import PlanetsView from './views/planets'
import MapView from './views/map'
import ShipView from './views/ship'
import {
Aid,
Expand Down Expand Up @@ -230,7 +230,7 @@ export const mockSellers = [
*/
export const views = {
Market: MarketView,
Planets: PlanetsView,
Map: MapView,
Ship: ShipView
}

Expand Down
7 changes: 4 additions & 3 deletions src/views/planets.js → src/views/map.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,23 +3,24 @@ import PropTypes from 'prop-types'
import { connect } from 'react-redux'
import { Box } from '@material-ui/core'
import Map from '../components/Map'

/**
* Displays information about the planets.
*/
const PlanetsView = ({ planets }) => {
const MapView = ({ planets }) => {
return (
<Box>
<Map />
</Box>
)
}

PlanetsView.propTypes = {
MapView.propTypes = {
planets: PropTypes.array.isRequired
}

const mapStateToProps = ({ world }) => ({
planets: world.planets
})

export default connect(mapStateToProps)(PlanetsView)
export default connect(mapStateToProps)(MapView)

0 comments on commit d08ba55

Please sign in to comment.