forked from prescottprue/redux-firebasev3
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathhelpers.spec.js
52 lines (52 loc) · 1.4 KB
/
helpers.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
/* global describe expect it */
import helpers from '../../src/helpers'
const exampleData = { data: { some: 'data' }}
describe('helpers', () => {
it('toJS', () => {
describe('exists', () => {
expect(helpers).to.respondTo('toJS')
})
describe('handles non-immutable data', () => {
expect(helpers.toJS(exampleData)).to.equal(exampleData)
})
})
it('pathToJS', () => {
describe('exists', () => {
expect(helpers).to.respondTo('pathToJS')
})
describe('passes notSetValue', () => {
expect(helpers.pathToJS(exampleData, '/some', exampleData))
.to
.equal(exampleData)
})
})
it('dataToJS', () => {
describe('exists', () => {
expect(helpers).to.respondTo('dataToJS')
})
describe('passes notSetValue', () => {
expect(helpers.dataToJS(exampleData, '/some', exampleData))
.to
.equal(exampleData)
})
})
it('snapshotToJS', () => {
expect(helpers).to.respondTo('snapshotToJS')
})
it('customToJS', () => {
describe('exists', () => {
expect(helpers).to.respondTo('customToJS')
})
describe('passes notSetValue', () => {
expect(helpers.customToJS(exampleData, '/some', 'some', exampleData))
.to
.equal(exampleData)
})
})
it('isLoaded', () => {
expect(helpers).to.respondTo('isLoaded')
})
it('isEmpty', () => {
expect(helpers).to.respondTo('isEmpty')
})
})