Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…frontend into test/cypress-update
  • Loading branch information
Jesuitman committed Mar 1, 2024
2 parents 468d9cc + 80a61ba commit ef21ddb
Show file tree
Hide file tree
Showing 4 changed files with 59 additions and 26 deletions.
32 changes: 24 additions & 8 deletions cypress/e2e/spec.cy.js
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,6 @@ describe('NPS Service App', () => {
cy.get('p').should('contain', 'Benches/Seating');
cy.get('p').should('contain', 'Bicycle - Rack');
cy.get('p').should('have.length', 10);

});

cy.get('.park-details-activities').within(() => {
Expand Down Expand Up @@ -312,13 +311,30 @@ describe('NPS Service App', () => {
});

context('Bad URL testing', () => {
it('Should take you back to the main page when you put a bad URL in', () => {
it('Should take you to an error page when you enter a bad URL', () => {
cy.visit('http://localhost:3000/asgafgdfg');
cy.wait(5000)
cy.wait(5000);
cy.title().should('eq', 'NPS Service');
cy.get('.checkbox-list li').should('have.length', 2);
cy.get('.checkbox-list li:first-child').contains('Abraham Lincoln Birthplace National Historical Park');
cy.get('.checkbox-list li:last-child').contains('Zion National Park');
cy.get('.nav-header').should('be.visible');
cy.get('.error-display').should('be.visible');
cy.get('h2').contains('Please stay on the marked trails.');
cy.get('p').contains('Follow leave no trace guidelines and return to the visitor\'s center.');
cy.intercept('GET', "https://m4-parks-backend.onrender.com/api/v0/parks/", {
fixture: 'parks.json'
})
.as("getParks")
cy.intercept('GET', "https://m4-parks-backend.onrender.com/api/v0/parks/zion", {
fixture: 'zion-park.json'
})
.as("getZion")
cy.intercept('GET', "https://m4-parks-backend.onrender.com/api/v0/parks/abli", {
fixture: 'abli-park.json'
})
.as("getAbli")
cy.get('button').contains('Understood').click();
cy.url().should('eq', 'http://localhost:3000/');
cy.get('.nav-header').should('be.visible');
cy.get('.checkbox-list').should('be.visible');
});
})
})
});
});
6 changes: 6 additions & 0 deletions src/Navigation/Navigation.css
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,10 @@

.banner {
justify-content: center;
}

@media screen and (max-width: 600px) {
.welcome-message {
margin: 5px;
}
}
5 changes: 5 additions & 0 deletions src/ParkChecklist/ParkChecklist.css
Original file line number Diff line number Diff line change
Expand Up @@ -189,4 +189,9 @@ h2 {
width: calc(95% / 1);
box-sizing: border-box;
}
.state-selector {
display:flex;
flex-direction: column;
padding-left: 20px;
}
}
42 changes: 24 additions & 18 deletions src/SelectedStateParks/SelectedStateParks.css
Original file line number Diff line number Diff line change
@@ -1,25 +1,31 @@
.card-grid {
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 40px;
align-items: center;
margin: 2%;
margin-bottom: 0px;
}
display: grid;
grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
gap: 40px;
align-items: center;
margin: 2%;
margin-bottom: 0px;
align-self: center;
}

.no-state{
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
color: #333;
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
z-index: 999;
position: absolute;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
font-size: 24px;
color: #333;
background-color: rgba(255, 255, 255, 0.8);
padding: 20px;
border-radius: 10px;
box-shadow: 0 4px 8px rgba(0, 0, 0, 0.7);
z-index: 999;
}

@media screen and (max-width: 600px) {
.card-grid {
justify-items: center;
}
}


0 comments on commit ef21ddb

Please sign in to comment.