Mocking environment for PageTemplate tests

This commit is contained in:
Jeff Avallone 2018-02-11 09:45:46 -05:00
parent 70455ea2b8
commit a30d1f07fc
2 changed files with 15 additions and 2 deletions

View File

@ -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>

View File

@ -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>