Skip to content

Commit

Permalink
Starting work on tests
Browse files Browse the repository at this point in the history
  • Loading branch information
ravicodelabs authored Aug 9, 2024
1 parent b7a8bcf commit 8bc2d8b
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 5 deletions.
10 changes: 7 additions & 3 deletions cypress/e2e/desktop/siteInfo.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -21,17 +21,21 @@ describe('site info', () => {
// Switch to food view
cy.get('[data-cy=button-resource-type-menu]').click()
cy.get('[data-cy=button-FOOD-data-selector]').click()
cy.get('[data-cy=button-resource-type-menu]').click()

// Load a sample food site
// This is currently using live data, but should be updated to make use of test data.
cy.get('[title=data-cy-1]').click();
cy.get('[title=data-cy-2]').click();

cy.get('[data-cy=tap-organization-name]').should(
'have.text',
'Test Organization'
);
// Confirm that the modal represents a half-modal
// Expand the modal to a full-modal
// Confirm that the correct description for the location is displayed
// Confirm that the modal represents a full-modal


// cy.get('[title=data-cy-2]').click();
});

it('should successfully display a foraging site', () => {
Expand Down
23 changes: 22 additions & 1 deletion cypress/e2e/mobile/modals.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,28 @@ 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('[data-cy=button-FOOD-data-selector]').click();

// Load a sample food site
// This is currently using live data, but should be updated to make use of test data.
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


// Expand the modal to a full-modal
// Confirm that the correct description for the location is displayed
// Confirm that the modal represents a full-modal


});

it('should successfully display a foraging site', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,7 +86,10 @@ const MobileChooseResourceType = (props) => {
>
<List sx={{ maxWidth: 210 }}>
{props.resourceTypeInfo.map(entry => (
<MobileResourceButton key={entry.type} {...entry} />
<MobileResourceButton
key={entry.type}
{...entry}
data-cy={`button-${entry.type}-data-selector`} />
))}
</List>
</Slide>
Expand Down
1 change: 1 addition & 0 deletions src/components/SelectedTap/SelectedTap.css
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,7 @@
-webkit-line-clamp: 2;
-webkit-box-orient: vertical;
text-overflow: ellipsis;
color: greenyellow; /* debug! */
}
#tap-info-address {
text-align: start;
Expand Down

0 comments on commit 8bc2d8b

Please sign in to comment.