diff --git a/cypress/e2e/mobile/modals.cy.js b/cypress/e2e/mobile/modals.cy.js index bae555c5..46e47fb3 100644 --- a/cypress/e2e/mobile/modals.cy.js +++ b/cypress/e2e/mobile/modals.cy.js @@ -17,7 +17,33 @@ describe('modals', () => { }); it('should successfully display a food site', () => { - // TODO + // Switch to food view + cy.get('[data-cy=button-resource-type-menu]').click(); + cy.get('.MuiDialog-root:not(div[aria-hidden="true"]) [data-cy=mobile-button-FOOD-data-selector]').click(); + + // Load a sample food site + cy.get('[title=data-cy-1]').click(); + + // Confirm that the modal that pops up shows the correct name for the location + cy.get('[data-cy=tap-organization-name]').should( + 'have.text', + 'Test Organization' + ); + + // Confirm that the modal represents a half-modal + cy.get('mobile-site-info-drawer-open').should('not.exist'); + + // Expand the modal to a full-modal + cy.get('div[data-cy=expanded-site-info]').trigger('pointermove', { offsetX: 0, offsetY: -1 }); + + // Confirm that the modal represents a full-modal + cy.get('[data-cy=mobile-site-info-drawer-open]').should('exist'); + + // Confirm that the correct description for the location is displayed + cy.get('[data-cy=tap-description]').should( + 'have.text', + 'Sites are open Mondays and Thursdays from 10 a.m. – 12 p.m.\n\nResidents can pick up one box per household.\n\nBoxes contain non-perishable items on Mondays and fresh produce on Thursdays.\n\nResidents do not need to present an ID or proof of income for eligibility.\n\nFood sites are supported by the City, Share Food Program, and Philabundance.\n\nThese food sites are supplementary to the existing food pantry network. To find a food pantry closest to you, call 311.') + cy.wait(500); }); it('should successfully display a foraging site', () => { diff --git a/cypress/support/e2e.js b/cypress/support/e2e.js index d68db96d..37a498fb 100644 --- a/cypress/support/e2e.js +++ b/cypress/support/e2e.js @@ -14,7 +14,7 @@ // *********************************************************** // Import commands.js using ES2015 syntax: -import './commands' +import './commands'; // Alternatively you can use CommonJS syntax: // require('./commands') diff --git a/src/components/ChooseResourceType/MobileChooseResourceType.js b/src/components/ChooseResourceType/MobileChooseResourceType.js index 1237f284..9708569e 100644 --- a/src/components/ChooseResourceType/MobileChooseResourceType.js +++ b/src/components/ChooseResourceType/MobileChooseResourceType.js @@ -42,7 +42,9 @@ const MobileResourceButton = props => { switchType(props.type) }} > - + + + @@ -52,7 +54,7 @@ const MobileResourceButton = props => { - + ); }; @@ -86,7 +88,11 @@ const MobileChooseResourceType = (props) => { > {props.resourceTypeInfo.map(entry => ( - + ))} diff --git a/src/components/SelectedTapMobile/SelectedTapDetails.js b/src/components/SelectedTapMobile/SelectedTapDetails.js index e0a17b89..dfe10d08 100644 --- a/src/components/SelectedTapMobile/SelectedTapDetails.js +++ b/src/components/SelectedTapMobile/SelectedTapDetails.js @@ -112,11 +112,11 @@ function SelectedTapDetails(props) { }; return ( -
+
{isMobile && !infoCollapse ? ( ) : ( -
+
window.open( 'https://www.google.com/maps/dir/?api=1&destination=' + - resource.latitude + - ',' + - resource.longitude, + resource.latitude + + ',' + + resource.longitude, '_blank' ) } @@ -220,7 +220,7 @@ function SelectedTapDetails(props) {

Description

-

+

{resource.description ? resource.description : 'No description provided'}