diff --git a/cypress/integration/Map-spec.js b/cypress/integration/Map-spec.js index 5bfeea9..7f29c5d 100644 --- a/cypress/integration/Map-spec.js +++ b/cypress/integration/Map-spec.js @@ -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.', () => { diff --git a/src/components/TravelPrompt.js b/src/components/TravelPrompt.js index 9a71043..50572b9 100644 --- a/src/components/TravelPrompt.js +++ b/src/components/TravelPrompt.js @@ -13,12 +13,13 @@ import { instantTravel } from '../redux/actions/ship' const TravelPrompt = ({ destination, handleTravel, open, setOpen }) => { const handleClose = () => setOpen(false) + return ( - + TRAVEL_PROMPT - Are you sure you want to travel to PLANET_NAME? + Are you sure you want to travel to {destination.name}?