-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Newsletter section created * Update Routes * add eBL Newsletter 15 to about-news * Update news section * Update About News * Implement MD static loading, menu & routes * Format markdown * Move menu to the right * Style * Update Newsletter 10-14 * Upload Newsletter 1-9, update 10-11 * Format all md to satisfy markdownlint * Sync md. import & update * Adjust about & news behavior on tab and url change * Adjust bibliography routes and tests * Add tests --------- Co-authored-by: Enrique Jiménez <[email protected]> Co-authored-by: Ilya Khait <[email protected]>
- Loading branch information
1 parent
4b6ca50
commit a4249cb
Showing
30 changed files
with
997 additions
and
50 deletions.
There are no files selected for viewing
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 |
---|---|---|
|
@@ -4,4 +4,5 @@ REACT_APP_AUTH0_AUDIENCE=dictionary-api | |
REACT_APP_DICTIONARY_API_URL=http://example.com | ||
REACT_APP_SENTRY_DSN=http://example.com/sentry | ||
REACT_APP_CORRECTIONS_EMAIL=[email protected] | ||
REACT_APP_INFO_EMAIL=[email protected] | ||
REACT_APP_GA_TRACKING_ID=G-XXXXXXXXXX |
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 |
---|---|---|
|
@@ -64,6 +64,7 @@ jobs: | |
build-args: | | ||
REACT_APP_AUTH0_DOMAIN=auth.ebl.lmu.de | ||
REACT_APP_CORRECTIONS_EMAIL=ebl-support+corrections@culture.lmu.de | ||
[email protected] | ||
REACT_APP_AUTH0_CLIENT_ID=${{ secrets.REACT_APP_AUTH0_CLIENT_ID }} | ||
REACT_APP_AUTH0_AUDIENCE=${{ secrets.REACT_APP_AUTH0_AUDIENCE }} | ||
REACT_APP_DICTIONARY_API_URL=/api | ||
|
@@ -96,6 +97,7 @@ jobs: | |
build-args: | | ||
REACT_APP_AUTH0_DOMAIN=auth.ebl.lmu.de | ||
REACT_APP_CORRECTIONS_EMAIL=ebl-support+corrections@culture.lmu.de | ||
[email protected] | ||
REACT_APP_AUTH0_CLIENT_ID=${{ secrets.REACT_APP_AUTH0_CLIENT_ID }} | ||
REACT_APP_AUTH0_AUDIENCE=${{ secrets.REACT_APP_AUTH0_AUDIENCE }} | ||
REACT_APP_DICTIONARY_API_URL=/test/api | ||
|
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
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 |
---|---|---|
@@ -0,0 +1,50 @@ | ||
import React from 'react' | ||
import { render, screen } from '@testing-library/react' | ||
import AboutNews from './news' | ||
import { newsletters } from './news' | ||
import { Router } from 'react-router-dom' | ||
import { createMemoryHistory } from 'history' | ||
import { fireEvent } from '@testing-library/react' | ||
|
||
test('renders AboutNews component with default newsletter', () => { | ||
const history = createMemoryHistory() | ||
render( | ||
<Router history={history}> | ||
<AboutNews /> | ||
</Router> | ||
) | ||
expect( | ||
screen.getByText(new RegExp(`eBL Newsletter ${newsletters[0].number}`)) | ||
).toBeInTheDocument() | ||
}) | ||
|
||
test('renders AboutNews component with complete menu', () => { | ||
const history = createMemoryHistory() | ||
render( | ||
<Router history={history}> | ||
<AboutNews /> | ||
</Router> | ||
) | ||
newsletters.forEach((newsletter) => { | ||
expect( | ||
screen.getByText(new RegExp(`^Nr. ${newsletter.number}$`)) | ||
).toBeInTheDocument() | ||
}) | ||
}) | ||
|
||
test('updates active newsletter on link click', () => { | ||
const history = createMemoryHistory() | ||
render( | ||
<Router history={history}> | ||
<AboutNews /> | ||
</Router> | ||
) | ||
const secondNewsletterLink = screen.getByText( | ||
new RegExp(`Nr. ${newsletters[1].number}`) | ||
) | ||
fireEvent.click(secondNewsletterLink) | ||
expect(history.location.pathname).toBe(`/about/news/${newsletters[1].number}`) | ||
expect( | ||
screen.getByText(new RegExp(`eBL Newsletter ${newsletters[1].number}`)) | ||
).toBeInTheDocument() | ||
}) |
Oops, something went wrong.