Mocking environment for PageTemplate tests
This commit is contained in:
parent
70455ea2b8
commit
a30d1f07fc
@ -3,6 +3,19 @@ import renderer from 'react-test-renderer';
|
||||
|
||||
import PageTemplate from './PageTemplate';
|
||||
|
||||
const env = { ...process.env };
|
||||
|
||||
afterEach(() => {
|
||||
process.env = env;
|
||||
});
|
||||
|
||||
beforeEach(() => {
|
||||
process.env = {
|
||||
...process.env,
|
||||
BANNER: 'testing'
|
||||
};
|
||||
});
|
||||
|
||||
test('PageTemplate rendering', () => {
|
||||
const component = renderer.create(
|
||||
<PageTemplate>
|
||||
|
@ -24,7 +24,7 @@ exports[`PageTemplate rendering 1`] = `
|
||||
</head>
|
||||
<body>
|
||||
<header
|
||||
data-banner={undefined}
|
||||
data-banner="testing"
|
||||
id="main"
|
||||
>
|
||||
<h1>
|
||||
@ -103,7 +103,7 @@ exports[`PageTemplate rendering with title 1`] = `
|
||||
</head>
|
||||
<body>
|
||||
<header
|
||||
data-banner={undefined}
|
||||
data-banner="testing"
|
||||
id="main"
|
||||
>
|
||||
<h1>
|
||||
|
Loading…
Reference in New Issue
Block a user