Skip to content

Commit

Permalink
Merge pull request #31 from Refugee-Aid-Capstone/feature/contact-sypress
Browse files Browse the repository at this point in the history
Feature/contact sypress
  • Loading branch information
reneepinna authored Oct 21, 2023
2 parents bf3b913 + 8819170 commit be44fd8
Show file tree
Hide file tree
Showing 16 changed files with 375 additions and 120 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<div>
<h1 style="color:red; display: inline;">
Refuge
<!-- Refuge -->
<img src="https://github.com/Refugee-Aid-Capstone/refugee-aid-fe/blob/main/src/images/refuge.png" alt="refuge logo" width="105" style="margin-left: 5px; border-radius: 50%; vertical-align: middle;">
</h1>
</div>
Expand Down
39 changes: 39 additions & 0 deletions cypress/e2e/contactSection.cy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
describe('ContactSection Component - Happy Path', () => {

beforeEach(() => {
cy.visit('http://localhost:3000/');
});

it('should display the main elements of the homepage', () => {
cy.get('.home-header').should('be.visible');
cy.get('.nav-bar').should('be.visible');
cy.get('[href="/contact"]').should('contain', 'helpful resources');
cy.get('[href="/contact"]').click();
});

it('should render the component correctly', () => {
cy.visit('http://localhost:3000/contact');

cy.location('pathname').should('eq', '/contact');
cy.viewport(1280, 720);
cy.get('.weallhuman-img').should('be.visible');
});

it('should navigate to the contact page from the homepage', () => {
cy.visit('http://localhost:3000');
cy.get('.nav-bar').should('be.visible');
cy.get('[href="/contact"]').click();
cy.url().should('include', '/contact');
});
});

describe('ContactSection Component - Sad Path', () => {

it('should handle missing image gracefully', () => {
cy.intercept('GET', '**/usa-custom.jpeg', { statusCode: 404 });
cy.visit('http://localhost:3000/contact');
cy.reload();
cy.viewport(1280, 720);
cy.get('img[alt="usa-custom"]').should('be.visible');
});
});
14 changes: 7 additions & 7 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,6 @@
},
"devDependencies": {
"@babel/plugin-proposal-private-property-in-object": "^7.21.11",
"cypress": "^13.3.1"
"cypress": "^13.3.2"
}
}
2 changes: 1 addition & 1 deletion src/Components/Contact/Contact.js
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ const ContactSection = () => {
<div className="top-section">
<div className="left-side">
<div className="weallhuman-container">
<img src={weAllHuman} alt="Refugees" className="wehalluman-img" />
<img src={weAllHuman} alt="usa-custom" className="weallhuman-img" />
</div>
</div>
<div className="right-side">
Expand Down
3 changes: 2 additions & 1 deletion src/Components/DropDown/DropDown.scss
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
.suggestion-dropdown {
background-color: white;
// background-color: white;
background-color: #30acf6;
margin-right: 1rem;
flex: 1;
max-width: 300px;
Expand Down
46 changes: 24 additions & 22 deletions src/Components/Homepage/Homepage.scss
Original file line number Diff line number Diff line change
Expand Up @@ -25,11 +25,11 @@ $netflix-red: #E50914;
display: flex;
flex-direction: column;
align-items: center;
justify-content: flex-start;
justify-content: flex-start;
}

.content-section {
padding-top: 30px;
padding-top: 30px;
display: flex;
align-items: flex-start;
justify-content: space-between;
Expand All @@ -44,23 +44,23 @@ $netflix-red: #E50914;
display: flex;
justify-content: center;
align-items: center;
flex-direction: column;
flex-direction: column;

button.play-video,
button.play-video,
button.hide-video {
margin-top: 15px;
}
margin-top: 15px;
}

.media-content {
width: 100%;
display: flex;
justify-content: center;
align-items: center;
}

.video-controls {
margin-top: 20px;
text-align: center;
text-align: center;
}

.refugee-image-container {
Expand All @@ -72,16 +72,16 @@ $netflix-red: #E50914;
overflow: hidden;
position: relative;
}

.refugees-img {
margin-top: 30px;
top: 0;
left: 0;
right: 0;
bottom: 0;
max-width: 100%;
max-width: 100%;
height: auto;
margin: auto;
margin: auto;
display: block;
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.1);
border-radius: 8px;
Expand All @@ -95,22 +95,22 @@ $netflix-red: #E50914;
display: flex;
flex-direction: column;
justify-content: center;
align-items: center;
align-items: center;
padding: 40px;

.title-container {
margin-bottom: 20px;
background: linear-gradient(135deg, #e9f5fc, #fff);
padding: 10px 20px;
border-radius: 8px;
border-radius: 10px;
box-shadow: 0px 4px 15px rgba(0, 0, 0, 0.05);

h2 {
color: $primary-color;
letter-spacing: 1px;
text-transform: uppercase;
text-align: center;
font-weight: 600;
font-weight: 600;
font-size: 2.2rem;
line-height: 1.3;
}
Expand All @@ -121,16 +121,18 @@ $netflix-red: #E50914;
line-height: 1.6;
color: rgba(0, 0, 0, 0.7);
text-align: justify;
max-width: 80%;
font-size: 1.1rem;
color: #555;
max-width: 85%;
margin-bottom: 10px;
font-weight: 400;
}
}

.play-video, .hide-video {
.play-video,
.hide-video {
margin-top: 15px;
background-color: $netflix-red;
// background-color: #37b3fe;
border-radius: 30px;
color: #FFFFFF;
border: none;
Expand All @@ -154,9 +156,9 @@ $netflix-red: #E50914;
position: relative;
width: 100%;
padding-bottom: 56.25%;
border-radius: 15px;
border-radius: 15px;
overflow: hidden;
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
box-shadow: 0 4px 14px rgba(0, 0, 0, 0.1);
}

iframe {
Expand All @@ -172,9 +174,9 @@ iframe {
.content-section {
flex-direction: column;

.media-side, .text-side {
.media-side,
.text-side {
width: 100%;
}
}
}

}
3 changes: 2 additions & 1 deletion src/Components/NavBar/NavBar.scss
Original file line number Diff line number Diff line change
Expand Up @@ -95,7 +95,8 @@ body {

.nav-button {
background-color: #3498db;
color: #ffffff;
// color: #ffffff;
color: #031662;
border: none;
padding: 10px 20px;
border-radius: 5px;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,7 @@
border: none;
cursor: pointer;
transition: background-color 0.3s ease;
margin-top: 1rem;

// Approve button style
&:nth-child(1) {
Expand Down
Loading

0 comments on commit be44fd8

Please sign in to comment.