Commit 785e1882 authored by Jure's avatar Jure

Merge branch 'serialisable-config' into 'master'

New authsome mode config

See merge request !120
parents eee779cf 05fa5452
Pipeline #2912 canceled with stage
......@@ -5,4 +5,7 @@ module.exports = {
visible: true,
},
},
authsome: {
mode: 'fake-mode'
},
}
import Authsome from 'authsome'
import { connect } from 'react-redux'
import config from 'config'
const mode = require(config.authsome.mode)
// higher order component to inject authsome into a component
export default function withAuthsome() {
const authsome = new Authsome(config.authsome, {})
const authsome = new Authsome({...config.authsome, mode}, {})
function mapState(state) {
authsome.context = {
......
......@@ -3,6 +3,7 @@ import { shallow } from 'enzyme'
global.PUBSWEET_COMPONENTS = []
jest.mock('fake-mode', () => false, {virtual: true})
const {
AuthenticatedComponent,
} = require('../../src/components/AuthenticatedComponent')
......
import React from 'react'
import { shallow } from 'enzyme'
import { Authorize } from '../../src/helpers/Authorize'
jest.mock('fake-mode', () => false, {virtual: true})
global.PUBSWEET_COMPONENTS = []
......
......@@ -4,6 +4,7 @@ import configureStore from 'redux-mock-store'
import Authsome from 'authsome'
import withAuthsome from '../../src/helpers/withAuthsome'
jest.mock('fake-mode', () => false, {virtual: true})
describe('withAuthsome higher order component', () => {
const createStore = configureStore()
......
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