generated from Arquisoft/wiq_0
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #148 from Arquisoft/footer
Footer and about
- Loading branch information
Showing
16 changed files
with
224 additions
and
8 deletions.
There are no files selected for viewing
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,26 @@ | ||
import React from 'react'; | ||
import { useTranslation } from "react-i18next"; | ||
import '../../custom.css'; | ||
|
||
function About() { | ||
const t = useTranslation("global").t; | ||
|
||
const imageNames = ["person1.jpg", "person2.jpg", "person3.jpg", "person4.jpg", "person5.jpg", "person6.jpg"]; | ||
|
||
return ( | ||
<div> | ||
<h1>{t("about.hello")}</h1> | ||
<h2>{t("about.team")}</h2> | ||
<ul className="person-list"> | ||
{imageNames.map((imageName, index) => ( | ||
<li key={index} className="person-item"> | ||
<img src={`/${imageName}`} alt={`Person ${index + 1}`} className="person-image" /> | ||
{t(`about.name${index + 1}`)} | ||
</li> | ||
))} | ||
</ul> | ||
</div> | ||
); | ||
} | ||
|
||
export default About; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
import React from 'react'; | ||
import { render, screen } from '@testing-library/react'; | ||
import { BrowserRouter as Router } from 'react-router-dom'; | ||
import About from './About'; | ||
|
||
|
||
// Mocking useTranslation hook | ||
jest.mock('react-i18next', () => ({ | ||
useTranslation: () => ({ t: key => key }), | ||
})); | ||
|
||
describe('About', () => { | ||
test('renders about page', () => { | ||
render( | ||
<Router> | ||
<About /> | ||
</Router> | ||
); | ||
|
||
expect(screen.getByText('about.hello')).toBeInTheDocument(); | ||
|
||
expect(screen.getByText('about.name1')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name2')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name3')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name4')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name5')).toBeInTheDocument(); | ||
expect(screen.getByText('about.name6')).toBeInTheDocument(); | ||
|
||
|
||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
import React from 'react'; | ||
import '../../custom.css'; | ||
import { Link } from 'react-router-dom'; | ||
import { useTranslation } from "react-i18next"; | ||
|
||
function Footer() { | ||
const [t] = useTranslation("global"); | ||
|
||
return ( | ||
<footer className="footer-container"> | ||
<div></div> | ||
<a href="http://wiqen1b.serveminecraft.net:8000/api-doc/" className="API" target="_blank" rel="noopener noreferrer"> | ||
<p className='link-text'>{t("footer.API")}</p> | ||
</a> | ||
|
||
<Link to="/about" className="about"> | ||
<p className='link-text'>{t("footer.about")}</p> | ||
</Link> | ||
|
||
<a href="https://arquisoft.github.io/wiq_en1b/" className="ARC" target="_blank" rel="noopener noreferrer"> | ||
<p className='link-text'>{t("footer.ARC")}</p> | ||
</a> | ||
<div></div> | ||
|
||
</footer> | ||
); | ||
} | ||
|
||
export default Footer; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
import { render , screen } from '@testing-library/react'; | ||
import { initReactI18next } from 'react-i18next'; | ||
import i18en from 'i18next'; | ||
|
||
import App from '../../App' | ||
|
||
i18en.use(initReactI18next).init({ | ||
resources: {}, | ||
lng: 'en', | ||
interpolation:{ | ||
escapeValue: false, | ||
} | ||
}); | ||
global.i18en = i18en; | ||
|
||
describe('Footer fragment', () => { | ||
|
||
|
||
|
||
test('Footer renders correctly', async () => { | ||
render( | ||
<App /> | ||
); | ||
expect(screen.getByText('footer.about')).toBeInTheDocument(); | ||
expect(screen.getByText('footer.API')).toBeInTheDocument(); | ||
expect(screen.getByText('footer.ARC')).toBeInTheDocument(); | ||
|
||
|
||
|
||
|
||
|
||
}); | ||
}); | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters