-
Notifications
You must be signed in to change notification settings - Fork 817
/
Copy pathGoogleApiComponent.spec.js
70 lines (70 loc) · 1.8 KB
/
GoogleApiComponent.spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
// import React from 'react';
//
// import {shallow, mount, render} from 'enzyme';
// import {expect} from 'chai';
// import sinon from 'sinon';
//
// import {ScriptCache} from '../lib/ScriptCache'
// import GoogleApiComponent from '../GoogleApiComponent'
//
// const C = React.createClass({
// render: function() {
// return (
// <div>Sample component</div>
// )
// }
// })
//
// const createCache = (res) => (obj) => {
// let cache = ScriptCache(global)(obj);
// sinon.stub(cache, '_scriptTag').returns(res)
// return cache;
// }
//
// const apiKey = 'abc-123'
// const newElement = {};
// const Wrapped = GoogleApiComponent({apiKey: apiKey, createCache: createCache(newElement)})(C);
//
// // const jsdom = require('jsdom')
// // global.document = jsdom.jsdom('', {
// // globalize: true,
// // console: true,
// // useEach: false,
// // skipWindowCheck: false,
// // });
//
// describe('GoogleApiComponent', () => {
// let wrapper;
//
// beforeEach(() => {
// wrapper = shallow(<Wrapped apiKey={apiKey}/>)
// })
//
// it('loads the component', () => {
// expect(wrapper.find('div').length).to.be.at.least(1);
// });
//
// describe('map props', () => {
// let wrapped;
// beforeEach(() => {
// wrapper = mount(<Wrapped apiKey={apiKey}/>)
// wrapped = wrapper.childAt(0);
// })
//
// it('adds a loading prop', () => {
// expect(wrapped.props().loaded).to.be.falsy;
// })
//
// it('adds a `google` prop', () => {
// expect(wrapped.props().google).to.be.null;
// });
//
// it('adds a `map` prop', () => {
// expect(wrapped.props().map).to.be.null;
// })
//
// describe('onLoad', () => {})
//
// })
//
// })