1 | import reduxGrid from 'redux-pager'
|
2 | import React from 'react'
|
3 | import Immutable from 'immutable'
|
4 | import * as ReactVirtualized from 'react-virtualized'
|
5 | import { createStore } from 'redux'
|
6 | import { Provider, connect } from 'react-redux'
|
7 | import { mount, shallow } from 'enzyme'
|
8 | import { spy } from 'sinon'
|
9 | const chai = require('chai')
|
10 | chai.use(require('chai-enzyme')())
|
11 | const should = chai.should()
|
12 |
|
13 | describe('reduxGrid', () => {
|
14 | it('exists', () => should.exist(reduxGrid))
|
15 | it('should be a function', () => reduxGrid.should.be.a('function'))
|
16 | it('throws for no parameters', () => (() => reduxGrid()).should.throw())
|
17 | it('should throw for invalid dependencies (React, ReactVirtualized, connect)', () => (() => reduxGrid({ React, ReactVirtualized, connect })).should.throw())
|
18 |
|
19 | const getState = () => {}
|
20 | const ContentBox = props => <div>{props.children}</div>
|
21 | it('should not throw for valid dependencies (React, ReactVirtualized, connect, getState, Immutable, ContentBox)', () => (() => reduxGrid({ React, ReactVirtualized, connect, getState, Immutable, ContentBox })).should.not.throw())
|
22 |
|
23 | describe('<CoreGrid />', () => {
|
24 | const reducer = (state = {}, action = {}) => {}
|
25 | const store = createStore(reducer)
|
26 | const { CoreGrid } = reduxGrid({ React, ReactVirtualized, connect, getState, Immutable, ContentBox })
|
27 | it('should exist', () => should.exist(CoreGrid))
|
28 | it('should shallow mount', () => (() => shallow(<Provider store={store}><CoreGrid /></Provider>)).should.not.throw())
|
29 | })
|
30 |
|
31 | describe('<DrillGrid />', () => {
|
32 | const reducer = (state = {}, action = {}) => {}
|
33 | const store = createStore(reducer)
|
34 | const { DrillGrid } = reduxGrid({ React, ReactVirtualized, connect, getState, Immutable, ContentBox })
|
35 | it('should exist', () => should.exist(DrillGrid))
|
36 | it('should shallow mount', () => (() => shallow(<Provider store={store}><DrillGrid /></Provider>)).should.not.throw())
|
37 | })
|
38 | })
|
39 |
|
40 |
|