Skip to content

Commit

Permalink
Merge 7148255 into b1c4f0d
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex Lee committed Sep 25, 2019
2 parents b1c4f0d + 7148255 commit eb3e3d3
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 4 deletions.
11 changes: 9 additions & 2 deletions cypress/integration/Map-spec.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,18 @@ describe('Map', () => {
})

// * Update this in the future
it('Should display an prompt when clicking a planet.', () => {
it('Should display a prompt when clicking a planet.', () => {
cy.get('body')
.contains(mockState.world.planets[2].name)
.click()
cy.get('body').contains('TRAVEL_PROMPT')
cy.get('#travel-prompt').contains('TRAVEL_PROMPT')
})

it("Should display the clicked planet's name in the Travel Prompt.", () => {
cy.get('body')
.contains(mockState.world.planets[2].name)
.click()
cy.get('#travel-prompt').contains(mockState.world.planets[2].name)
})

it('Should indicate the Home Planet.', () => {
Expand Down
5 changes: 3 additions & 2 deletions src/components/TravelPrompt.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,13 @@ import { instantTravel } from '../redux/actions/ship'

const TravelPrompt = ({ destination, handleTravel, open, setOpen }) => {
const handleClose = () => setOpen(false)

return (
<Dialog open={open} onClose={handleClose}>
<Dialog id="travel-prompt" open={open} onClose={handleClose}>
<DialogTitle>TRAVEL_PROMPT</DialogTitle>
<DialogContent>
<DialogContentText>
Are you sure you want to travel to PLANET_NAME?
Are you sure you want to travel to {destination.name}?
</DialogContentText>
</DialogContent>
<DialogActions>
Expand Down

0 comments on commit eb3e3d3

Please sign in to comment.