-
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.
- Loading branch information
Jim Skerritt
committed
Nov 27, 2018
1 parent
9d92e35
commit 4f20107
Showing
4 changed files
with
24 additions
and
22 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,16 +1,18 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { mount } from 'enzyme'; | ||
import Helmet from 'react-helmet'; | ||
import Gtm from '../lib/Gtm'; | ||
|
||
describe('Gtm', () => { | ||
test('exists and is not null', () => { | ||
const element = shallow(<Gtm />); | ||
const element = mount(<Gtm />); | ||
expect(element.exists()).toBe(true); | ||
expect(element.getElement()).not.toBe(null); | ||
}); | ||
|
||
test('contains containerId', () => { | ||
const element = shallow(<Gtm containerId="test12345" />); | ||
expect(element.html()).toMatch(`test12345`); | ||
mount(<Gtm containerId="test12345" />); | ||
const helmet = Helmet.peek(); | ||
expect(helmet.scriptTags.some(tag => tag.innerHTML.indexOf(`test12345`) > -1)).toBe(true); | ||
}); | ||
}); |
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,16 +1,18 @@ | ||
import React from 'react'; | ||
import { shallow } from 'enzyme'; | ||
import { mount } from 'enzyme'; | ||
import Helmet from 'react-helmet'; | ||
import Vwo from '../lib/Vwo'; | ||
|
||
describe('Vwo', () => { | ||
test('exists and is not null', () => { | ||
const element = shallow(<Vwo />); | ||
const element = mount(<Vwo />); | ||
expect(element.exists()).toBe(true); | ||
expect(element.getElement()).not.toBe(null); | ||
}); | ||
|
||
test('contains accountId', () => { | ||
const element = shallow(<Vwo accountId="test12345" />); | ||
expect(element.html()).toMatch(`test12345`); | ||
mount(<Vwo accountId="test12345" />); | ||
const helmet = Helmet.peek(); | ||
expect(helmet.scriptTags.some(tag => tag.innerHTML.indexOf(`test12345`) > -1)).toBe(true); | ||
}); | ||
}); |
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