Commit 499b9d33 authored by Rik Smith-Unna's avatar Rik Smith-Unna
Browse files

All reducer tests fixed

parent 0fd6ef1b
Pipeline #1108 failed with stage
in 5 minutes and 37 seconds
......@@ -10,7 +10,7 @@
"eslint": "eslint"
},
"engines": {
"node": ">=5.0.0",
"node": ">=7.7.0",
"npm": ">=3.0.0"
},
"author": "Collaborative Knowledge Foundation",
......
const allreducers = require.requireActual('../../src/reducers')
const allreducers = require.requireActual('../../src/reducers').default
const expect = require.requireActual('chai').expect
const describeReducerSet = (key, reducers, cb) => describe(key, () => {
it('is exported from the file', () => {
expect(reducers).to.have.property(key)
expect(reducers).to.have.property('default')
})
it('is exported in the all reducers object', () => {
......@@ -11,7 +11,7 @@ const describeReducerSet = (key, reducers, cb) => describe(key, () => {
})
it('is a function', () => {
expect(reducers[key]).to.be.a('function')
expect(reducers.default).to.be.a('function')
})
if (cb) cb()
......
jasmine.DEFAULT_TIMEOUT_INTERVAL = 600000
process.env.NODE_ENV = 'production'
process.env.SILENT_NPM = 'true'
global.PUBSWEET_COMPONENTS = []
......
......@@ -13,7 +13,7 @@ module.exports = app => describeReducerSet('collections', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['collections'])
)(reducers.default)
describeReducer('getCollections success', {
state: [mockcol],
......
......@@ -6,7 +6,7 @@ const T = require('../../src/actions/types')
module.exports = app => describeReducerSet('currentUser', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['currentUser'])
)(reducers.default)
const mockuser = {
name: 'jo johnson'
......
......@@ -8,7 +8,7 @@ const clone = require('lodash/clone')
module.exports = app => describeReducerSet('fileUpload', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['fileUpload'])
)(reducers.default)
describeReducer('fileUpload success', {
action: {
......
......@@ -8,7 +8,7 @@ const clone = require('lodash/clone')
module.exports = app => describeReducerSet('fragments', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['fragments'])
)(reducers.default)
const mockcol = app.collection
mockcol.fragments = []
......
......@@ -8,7 +8,7 @@ const clone = require('lodash/clone')
module.exports = app => describeReducerSet('teams', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['teams'])
)(reducers.default)
const mockteam = { name: 'someteam', id: '1234' }
const mockstate = [mockteam]
......
......@@ -8,7 +8,7 @@ const clone = require('lodash/clone')
module.exports = app => describeReducerSet('users', reducers, () => {
const describeReducer = require.requireActual(
'../helpers/describeReducer'
)(reducers['users'])
)(reducers.default)
const user = app.user
const usermod = clone(user)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment