forked from dedis/d-voting
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Footer UI tests
- Loading branch information
Showing
11 changed files
with
111 additions
and
148 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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 was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,34 +1,28 @@ | ||
import ProxyInput from 'components/utils/proxy'; | ||
import { useTranslation } from 'react-i18next'; | ||
|
||
const Footer = () => ( | ||
<div className="flex flex-row border-t justify-center bg-white items-center w-full p-4 text-gray-300 text-xs"> | ||
<footer> | ||
<div className="hidden sm:flex flex-row items-center max-w-7xl mx-auto py-2 px-4 overflow-hidden sm:px-6 lg:px-8"> | ||
<span className="text-gray-400"> © 2022 DEDIS LAB - </span> | ||
<a className="text-gray-600" href="https://github.com/c4dt/d-voting"> | ||
https://github.com/c4dt/d-voting | ||
</a> | ||
<div className="px-10"> | ||
<ProxyInput /> | ||
const Footer = () => { | ||
const { t } = useTranslation(); | ||
return ( | ||
<div className="flex flex-row border-t justify-center bg-white items-center w-full p-4 text-gray-300 text-xs"> | ||
<footer data-testid="footer"> | ||
<div className="hidden sm:flex flex-row items-center max-w-7xl mx-auto py-2 px-4 overflow-hidden sm:px-6 lg:px-8"> | ||
<span data-testid="footerCopyright" className="text-gray-400"> | ||
© {new Date().getFullYear()} {t('footerCopyright')} | ||
<a className="text-gray-600" href="https://github.com/c4dt/d-voting"> | ||
https://github.com/c4dt/d-voting | ||
</a> | ||
</span> | ||
</div> | ||
</div> | ||
<div className="flex sm:hidden flex-col items-center max-w-7xl mx-auto py-2 px-4 overflow-hidden sm:px-6 lg:px-8"> | ||
<span className="text-gray-400"> © 2022 DEDIS LAB - </span> | ||
<a className="text-gray-600" href="https://github.com/c4dt/d-voting"> | ||
https://github.com/c4dt/d-voting | ||
</a> | ||
<div className="pt-2"> | ||
<ProxyInput /> | ||
<div data-testid="footerVersion" className="text-center"> | ||
{t('footerVersion')} {process.env.REACT_APP_VERSION || t('footerUnknown')} | ||
- {t('footerBuild')} | ||
{process.env.REACT_APP_BUILD || t('footerUnknown')} | ||
- {t('footerBuildTime')} | ||
{process.env.REACT_APP_BUILD_TIME || t('footerUnknown')} | ||
</div> | ||
</div> | ||
<div className="text-center"> | ||
version: | ||
{process.env.REACT_APP_VERSION || 'unknown'} - build{' '} | ||
{process.env.REACT_APP_BUILD || 'unknown'} - on{' '} | ||
{process.env.REACT_APP_BUILD_TIME || 'unknown'} | ||
</div> | ||
</footer> | ||
</div> | ||
); | ||
</footer> | ||
</div> | ||
); | ||
}; | ||
|
||
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,29 @@ | ||
import { test, expect } from '@playwright/test'; | ||
import { default as i18n } from 'i18next'; | ||
import { initI18n, setUp, getFooter } from './shared'; | ||
|
||
initI18n(); | ||
|
||
test.beforeEach(async ({ page }) => { | ||
await setUp(page, '/about'); | ||
}); | ||
|
||
test('Assert copyright notice is visible', async({ page }) => { | ||
const footerCopyright = await page.getByTestId('footerCopyright'); | ||
await expect(footerCopyright).toBeVisible(); | ||
await expect(footerCopyright).toHaveText( | ||
`© ${new Date().getFullYear()} ${i18n.t('footerCopyright')} https://github.com/c4dt/d-voting` | ||
); | ||
}); | ||
|
||
test('Assert version information is visible', async({ page }) => { | ||
const footerVersion = await page.getByTestId('footerVersion'); | ||
await expect(footerVersion).toBeVisible(); | ||
await expect(footerVersion).toHaveText( | ||
[ | ||
`${i18n.t('footerVersion')} ${process.env.REACT_APP_VERSION || i18n.t('footerUnknown')}`, | ||
`${i18n.t('footerBuild')} ${process.env.REACT_APP_BUILD || i18n.t('footerUnknown')}`, | ||
`${i18n.t('footerBuildTime')} ${process.env.REACT_APP_BUILD_TIME || i18n.t('footerUnknown')}`, | ||
].join(' - ') | ||
); | ||
}); |
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