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'; import PageTemplate from './PageTemplate';
const env = { ...process.env };
afterEach(() => {
process.env = env;
});
beforeEach(() => {
process.env = {
...process.env,
BANNER: 'testing'
};
});
test('PageTemplate rendering', () => { test('PageTemplate rendering', () => {
const component = renderer.create( const component = renderer.create(
<PageTemplate> <PageTemplate>

View File

@ -24,7 +24,7 @@ exports[`PageTemplate rendering 1`] = `
</head> </head>
<body> <body>
<header <header
data-banner={undefined} data-banner="testing"
id="main" id="main"
> >
<h1> <h1>
@ -103,7 +103,7 @@ exports[`PageTemplate rendering with title 1`] = `
</head> </head>
<body> <body>
<header <header
data-banner={undefined} data-banner="testing"
id="main" id="main"
> >
<h1> <h1>