-
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.
Merge pull request #272 from MoTrPAC/265_JZ_Homepage_Redesign_Jest_Test
Connects to #265. Jest test runner errors.
- Loading branch information
Showing
7 changed files
with
51 additions
and
17 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
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,12 @@ | ||
import React from 'react'; | ||
import VideoMoleculeNetwork from '../../assets/LandingPageGraphics/background_video_molecules_221511488.mp4'; | ||
|
||
function BackgroundVideo() { | ||
return ( | ||
<video className="fullscreen" autoPlay muted loop> | ||
<source src={VideoMoleculeNetwork} type="video/mp4" /> | ||
</video> | ||
); | ||
} | ||
|
||
export default BackgroundVideo; |
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,12 +1,28 @@ | ||
import { configure } from 'enzyme'; | ||
import Adapter from '@wojtekmaj/enzyme-adapter-react-17'; | ||
|
||
const crypto = require('crypto'); | ||
|
||
configure({ adapter: new Adapter() }); | ||
|
||
require('jest-canvas-mock'); | ||
|
||
jest.mock('react-chartjs-2', () => ({ | ||
Bar: () => null, | ||
Pie: () => null, | ||
Doughnut: () => null | ||
Doughnut: () => null, | ||
})); | ||
|
||
// fix for 'crypto.getRandomValues() not supported' error | ||
Object.defineProperty(globalThis, 'crypto', { | ||
value: { | ||
getRandomValues: (arr) => crypto.randomBytes(arr.length), | ||
}, | ||
}); | ||
|
||
// fix for 'unstable_flushDiscreteUpdates: Cannot flush updates when React is already rendering' error | ||
// when <video> is used in a component | ||
// (https://github.com/testing-library/react-testing-library/issues/470#issuecomment-761821103) | ||
Object.defineProperty(HTMLMediaElement.prototype, 'muted', { | ||
set: () => {}, | ||
}); |