Commit 4157859d authored by Eduardo Sanz García's avatar Eduardo Sanz García Committed by Eduardo

Rename exports in `src/sidebar/store/modules`

This is the convention that I followed to export objects in the
`src/sidebar/store/modules`:  name of the file plus the word `Module`. For example, `direct-linked.js` exports `directLinkedModule`.
parent c3e2a91b
import { createStore } from './create-store'; import { createStore } from './create-store';
import { debugMiddleware } from './debug-middleware'; import { debugMiddleware } from './debug-middleware';
import { activity } from './modules/activity'; import { activityModule } from './modules/activity';
import { annotations } from './modules/annotations'; import { annotationsModule } from './modules/annotations';
import { defaults } from './modules/defaults'; import { defaultsModule } from './modules/defaults';
import { directLinked } from './modules/direct-linked'; import { directLinkedModule } from './modules/direct-linked';
import { drafts } from './modules/drafts'; import { draftsModule } from './modules/drafts';
import { filters } from './modules/filters'; import { filtersModule } from './modules/filters';
import { framesModule as frames } from './modules/frames'; import { framesModule } from './modules/frames';
import { groups } from './modules/groups'; import { groupsModule } from './modules/groups';
import { links } from './modules/links'; import { linksModule } from './modules/links';
import { realTimeUpdates } from './modules/real-time-updates'; import { realTimeUpdatesModule } from './modules/real-time-updates';
import { routeModule as route } from './modules/route'; import { routeModule } from './modules/route';
import { selection } from './modules/selection'; import { selectionModule } from './modules/selection';
import { session } from './modules/session'; import { sessionModule } from './modules/session';
import { sidebarPanels } from './modules/sidebar-panels'; import { sidebarPanelsModule } from './modules/sidebar-panels';
import { toastMessages } from './modules/toast-messages'; import { toastMessagesModule } from './modules/toast-messages';
import { viewer } from './modules/viewer'; import { viewerModule } from './modules/viewer';
/** /**
* @template M * @template M
...@@ -23,22 +23,22 @@ import { viewer } from './modules/viewer'; ...@@ -23,22 +23,22 @@ import { viewer } from './modules/viewer';
*/ */
/** /**
* @typedef {StoreFromModule<activity> & * @typedef {StoreFromModule<activityModule> &
* StoreFromModule<annotations> & * StoreFromModule<annotationsModule> &
* StoreFromModule<defaults> & * StoreFromModule<defaultsModule> &
* StoreFromModule<directLinked> & * StoreFromModule<directLinkedModule> &
* StoreFromModule<drafts> & * StoreFromModule<draftsModule> &
* StoreFromModule<filters> & * StoreFromModule<filtersModule> &
* StoreFromModule<frames> & * StoreFromModule<framesModule> &
* StoreFromModule<groups> & * StoreFromModule<groupsModule> &
* StoreFromModule<links> & * StoreFromModule<linksModule> &
* StoreFromModule<realTimeUpdates> & * StoreFromModule<realTimeUpdatesModule> &
* StoreFromModule<route> & * StoreFromModule<routeModule> &
* StoreFromModule<selection> & * StoreFromModule<selectionModule> &
* StoreFromModule<session> & * StoreFromModule<sessionModule> &
* StoreFromModule<sidebarPanels> & * StoreFromModule<sidebarPanelsModule> &
* StoreFromModule<toastMessages> & * StoreFromModule<toastMessagesModule> &
* StoreFromModule<viewer> * StoreFromModule<viewerModule>
* } SidebarStore * } SidebarStore
*/ */
...@@ -59,22 +59,22 @@ export function createSidebarStore(settings) { ...@@ -59,22 +59,22 @@ export function createSidebarStore(settings) {
const middleware = [debugMiddleware]; const middleware = [debugMiddleware];
const modules = [ const modules = [
activity, activityModule,
annotations, annotationsModule,
defaults, defaultsModule,
directLinked, directLinkedModule,
drafts, draftsModule,
filters, filtersModule,
frames, framesModule,
links, linksModule,
groups, groupsModule,
realTimeUpdates, realTimeUpdatesModule,
route, routeModule,
selection, selectionModule,
session, sessionModule,
sidebarPanels, sidebarPanelsModule,
toastMessages, toastMessagesModule,
viewer, viewerModule,
]; ];
return /** @type {SidebarStore} */ ( return /** @type {SidebarStore} */ (
createStore(modules, [settings], middleware) createStore(modules, [settings], middleware)
......
...@@ -190,7 +190,7 @@ function isSavingAnnotation(state, annotation) { ...@@ -190,7 +190,7 @@ function isSavingAnnotation(state, annotation) {
/** @typedef {import('../../../types/api').Annotation} Annotation */ /** @typedef {import('../../../types/api').Annotation} Annotation */
export const activity = createStoreModule(initialState, { export const activityModule = createStoreModule(initialState, {
reducers, reducers,
namespace: 'activity', namespace: 'activity',
......
...@@ -559,7 +559,7 @@ function savedAnnotations(state) { ...@@ -559,7 +559,7 @@ function savedAnnotations(state) {
}); });
} }
export const annotations = createStoreModule(initialState, { export const annotationsModule = createStoreModule(initialState, {
namespace: 'annotations', namespace: 'annotations',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -49,7 +49,7 @@ function getDefaults(state) { ...@@ -49,7 +49,7 @@ function getDefaults(state) {
return state; return state;
} }
export const defaults = createStoreModule(initialState, { export const defaultsModule = createStoreModule(initialState, {
namespace: 'defaults', namespace: 'defaults',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -142,7 +142,7 @@ function directLinkedGroupFetchFailed(state) { ...@@ -142,7 +142,7 @@ function directLinkedGroupFetchFailed(state) {
return state.directLinkedGroupFetchFailed; return state.directLinkedGroupFetchFailed;
} }
export const directLinked = createStoreModule(initialState, { export const directLinkedModule = createStoreModule(initialState, {
namespace: 'directLinked', namespace: 'directLinked',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -186,7 +186,7 @@ const unsavedAnnotations = createSelector( ...@@ -186,7 +186,7 @@ const unsavedAnnotations = createSelector(
drafts => drafts.filter(d => !d.annotation.id).map(d => d.annotation) drafts => drafts.filter(d => !d.annotation.id).map(d => d.annotation)
); );
export const drafts = createStoreModule(initialState, { export const draftsModule = createStoreModule(initialState, {
namespace: 'drafts', namespace: 'drafts',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -279,7 +279,7 @@ function hasAppliedFilter(state) { ...@@ -279,7 +279,7 @@ function hasAppliedFilter(state) {
return !!(state.query || Object.keys(getFilters(state)).length); return !!(state.query || Object.keys(getFilters(state)).length);
} }
export const filters = createStoreModule(initialState, { export const filtersModule = createStoreModule(initialState, {
namespace: 'filters', namespace: 'filters',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -3,7 +3,7 @@ import { createSelector } from 'reselect'; ...@@ -3,7 +3,7 @@ import { createSelector } from 'reselect';
import * as util from '../util'; import * as util from '../util';
import { createStoreModule } from '../create-store'; import { createStoreModule } from '../create-store';
import { session } from './session'; import { sessionModule } from './session';
/** /**
* @typedef {import('../../../types/api').Group} Group * @typedef {import('../../../types/api').Group} Group
...@@ -235,7 +235,7 @@ const getInScopeGroups = createSelector( ...@@ -235,7 +235,7 @@ const getInScopeGroups = createSelector(
const getMyGroups = createSelector( const getMyGroups = createSelector(
/** @param {{ groups: State, session: SessionState }} rootState */ /** @param {{ groups: State, session: SessionState }} rootState */
rootState => filteredGroups(rootState.groups), rootState => filteredGroups(rootState.groups),
rootState => session.selectors.isLoggedIn(rootState.session), rootState => sessionModule.selectors.isLoggedIn(rootState.session),
(groups, loggedIn) => { (groups, loggedIn) => {
// If logged out, the Public group still has isMember set to true so only // If logged out, the Public group still has isMember set to true so only
// return groups with membership in logged in state. // return groups with membership in logged in state.
...@@ -261,7 +261,7 @@ const getCurrentlyViewingGroups = createSelector( ...@@ -261,7 +261,7 @@ const getCurrentlyViewingGroups = createSelector(
} }
); );
export const groups = createStoreModule(initialState, { export const groupsModule = createStoreModule(initialState, {
namespace: 'groups', namespace: 'groups',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -51,7 +51,7 @@ function getLink(state, linkName, params = {}) { ...@@ -51,7 +51,7 @@ function getLink(state, linkName, params = {}) {
return url; return url;
} }
export const links = createStoreModule(initialState, { export const linksModule = createStoreModule(initialState, {
namespace: 'links', namespace: 'links',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -12,9 +12,9 @@ import { createSelector } from 'reselect'; ...@@ -12,9 +12,9 @@ import { createSelector } from 'reselect';
import { createStoreModule } from '../create-store'; import { createStoreModule } from '../create-store';
import { actionTypes } from '../util'; import { actionTypes } from '../util';
import { annotations } from './annotations'; import { annotationsModule } from './annotations';
import { groups } from './groups'; import { groupsModule } from './groups';
import { routeModule as route } from './route'; import { routeModule } from './route';
const initialState = { const initialState = {
/** /**
...@@ -112,8 +112,8 @@ function receiveRealTimeUpdates({ ...@@ -112,8 +112,8 @@ function receiveRealTimeUpdates({
const routeState = getState().route; const routeState = getState().route;
if ( if (
ann.group === groups.selectors.focusedGroupId(groupState) || ann.group === groupsModule.selectors.focusedGroupId(groupState) ||
route.selectors.route(routeState) !== 'sidebar' routeModule.selectors.route(routeState) !== 'sidebar'
) { ) {
pendingUpdates[/** @type {string} */ (ann.id)] = ann; pendingUpdates[/** @type {string} */ (ann.id)] = ann;
} }
...@@ -130,7 +130,7 @@ function receiveRealTimeUpdates({ ...@@ -130,7 +130,7 @@ function receiveRealTimeUpdates({
// new annotation (saved in pendingUpdates and removed above), that has // new annotation (saved in pendingUpdates and removed above), that has
// not yet been loaded. // not yet been loaded.
const annotationsState = getState().annotations; const annotationsState = getState().annotations;
if (annotations.selectors.annotationExists(annotationsState, id)) { if (annotationsModule.selectors.annotationExists(annotationsState, id)) {
pendingDeletions[id] = true; pendingDeletions[id] = true;
} }
}); });
...@@ -193,7 +193,7 @@ function hasPendingDeletion(state, id) { ...@@ -193,7 +193,7 @@ function hasPendingDeletion(state, id) {
return state.pendingDeletions.hasOwnProperty(id); return state.pendingDeletions.hasOwnProperty(id);
} }
export const realTimeUpdates = createStoreModule(initialState, { export const realTimeUpdatesModule = createStoreModule(initialState, {
namespace: 'realTimeUpdates', namespace: 'realTimeUpdates',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -381,7 +381,7 @@ const sortKeys = createSelector( ...@@ -381,7 +381,7 @@ const sortKeys = createSelector(
} }
); );
export const selection = createStoreModule(initialState, { export const selectionModule = createStoreModule(initialState, {
namespace: 'selection', namespace: 'selection',
reducers, reducers,
......
...@@ -117,7 +117,7 @@ function profile(state) { ...@@ -117,7 +117,7 @@ function profile(state) {
return state.profile; return state.profile;
} }
export const session = createStoreModule(initialState, { export const sessionModule = createStoreModule(initialState, {
namespace: 'session', namespace: 'session',
reducers, reducers,
......
...@@ -121,7 +121,7 @@ function isSidebarPanelOpen(state, panelName) { ...@@ -121,7 +121,7 @@ function isSidebarPanelOpen(state, panelName) {
return state.activePanelName === panelName; return state.activePanelName === panelName;
} }
export const sidebarPanels = createStoreModule(initialState, { export const sidebarPanelsModule = createStoreModule(initialState, {
namespace: 'sidebarPanels', namespace: 'sidebarPanels',
reducers, reducers,
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { activity } from '../activity'; import { activityModule } from '../activity';
describe('sidebar/store/modules/activity', () => { describe('sidebar/store/modules/activity', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([activity]); store = createStore([activityModule]);
}); });
describe('hasFetchedAnnotations', () => { describe('hasFetchedAnnotations', () => {
......
import * as fixtures from '../../../test/annotation-fixtures'; import * as fixtures from '../../../test/annotation-fixtures';
import * as metadata from '../../../helpers/annotation-metadata'; import * as metadata from '../../../helpers/annotation-metadata';
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { annotations } from '../annotations'; import { annotationsModule } from '../annotations';
import { routeModule as route } from '../route'; import { routeModule } from '../route';
function createTestStore() { function createTestStore() {
return createStore([annotations, route], [{}]); return createStore([annotationsModule, routeModule], [{}]);
} }
// Tests for some of the functionality in this store module are currently in // Tests for some of the functionality in this store module are currently in
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { defaults } from '../defaults'; import { defaultsModule } from '../defaults';
describe('store/modules/defaults', () => { describe('store/modules/defaults', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([defaults]); store = createStore([defaultsModule]);
}); });
describe('actions', () => { describe('actions', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { directLinked } from '../direct-linked'; import { directLinkedModule } from '../direct-linked';
describe('sidebar/store/modules/direct-linked', () => { describe('sidebar/store/modules/direct-linked', () => {
let store; let store;
...@@ -11,7 +11,7 @@ describe('sidebar/store/modules/direct-linked', () => { ...@@ -11,7 +11,7 @@ describe('sidebar/store/modules/direct-linked', () => {
beforeEach(() => { beforeEach(() => {
fakeSettings = {}; fakeSettings = {};
store = createStore([directLinked], [fakeSettings]); store = createStore([directLinkedModule], [fakeSettings]);
}); });
describe('setDirectLinkedGroupFetchFailed', () => { describe('setDirectLinkedGroupFetchFailed', () => {
...@@ -35,7 +35,7 @@ describe('sidebar/store/modules/direct-linked', () => { ...@@ -35,7 +35,7 @@ describe('sidebar/store/modules/direct-linked', () => {
it('sets directLinkedAnnotationId to settings.annotations during store init', () => { it('sets directLinkedAnnotationId to settings.annotations during store init', () => {
fakeSettings.annotations = 'ann-id'; fakeSettings.annotations = 'ann-id';
store = createStore([directLinked], [fakeSettings]); store = createStore([directLinkedModule], [fakeSettings]);
assert.equal(store.directLinkedAnnotationId(), 'ann-id'); assert.equal(store.directLinkedAnnotationId(), 'ann-id');
}); });
...@@ -51,7 +51,7 @@ describe('sidebar/store/modules/direct-linked', () => { ...@@ -51,7 +51,7 @@ describe('sidebar/store/modules/direct-linked', () => {
it('sets directLinkedGroupId to settings.group during store init', () => { it('sets directLinkedGroupId to settings.group during store init', () => {
fakeSettings.group = 'group-id'; fakeSettings.group = 'group-id';
store = createStore([directLinked], [fakeSettings]); store = createStore([directLinkedModule], [fakeSettings]);
assert.equal(store.directLinkedGroupId(), 'group-id'); assert.equal(store.directLinkedGroupId(), 'group-id');
}); });
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { annotations } from '../annotations'; import { annotationsModule } from '../annotations';
import { drafts } from '../drafts'; import { draftsModule } from '../drafts';
import { Draft } from '../drafts'; import { Draft } from '../drafts';
import { selection } from '../selection'; import { selectionModule } from '../selection';
import { immutable } from '../../../util/immutable'; import { immutable } from '../../../util/immutable';
const fixtures = immutable({ const fixtures = immutable({
...@@ -31,7 +31,10 @@ describe('store/modules/drafts', () => { ...@@ -31,7 +31,10 @@ describe('store/modules/drafts', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([drafts, annotations, selection], [{}]); store = createStore(
[draftsModule, annotationsModule, selectionModule],
[{}]
);
}); });
describe('Draft', () => { describe('Draft', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { filters } from '../filters'; import { filtersModule } from '../filters';
import { selection } from '../selection'; import { selectionModule } from '../selection';
describe('sidebar/store/modules/filters', () => { describe('sidebar/store/modules/filters', () => {
let store; let store;
...@@ -11,7 +11,7 @@ describe('sidebar/store/modules/filters', () => { ...@@ -11,7 +11,7 @@ describe('sidebar/store/modules/filters', () => {
}; };
beforeEach(() => { beforeEach(() => {
store = createStore([filters, selection], fakeSettings); store = createStore([filtersModule, selectionModule], fakeSettings);
}); });
describe('actions', () => { describe('actions', () => {
...@@ -88,7 +88,7 @@ describe('sidebar/store/modules/filters', () => { ...@@ -88,7 +88,7 @@ describe('sidebar/store/modules/filters', () => {
it('disables focus mode if there is a conflicting filter key', () => { it('disables focus mode if there is a conflicting filter key', () => {
store = createStore( store = createStore(
[filters], [filtersModule],
[{ focus: { user: { username: 'somebody' } } }] [{ focus: { user: { username: 'somebody' } } }]
); );
...@@ -286,7 +286,7 @@ describe('sidebar/store/modules/filters', () => { ...@@ -286,7 +286,7 @@ describe('sidebar/store/modules/filters', () => {
describe('getFocusFilters', () => { describe('getFocusFilters', () => {
it('returns any set focus filters', () => { it('returns any set focus filters', () => {
store = createStore( store = createStore(
[filters], [filtersModule],
[ [
{ {
focus: { focus: {
...@@ -313,7 +313,7 @@ describe('sidebar/store/modules/filters', () => { ...@@ -313,7 +313,7 @@ describe('sidebar/store/modules/filters', () => {
it('returns true if user-focused mode is active', () => { it('returns true if user-focused mode is active', () => {
store = createStore( store = createStore(
[filters], [filtersModule],
[{ focus: { user: { username: 'somebody' } } }] [{ focus: { user: { username: 'somebody' } } }]
); );
...@@ -338,7 +338,7 @@ describe('sidebar/store/modules/filters', () => { ...@@ -338,7 +338,7 @@ describe('sidebar/store/modules/filters', () => {
it('returns false if user-focused mode is configured but inactive', () => { it('returns false if user-focused mode is configured but inactive', () => {
store = createStore( store = createStore(
[filters], [filtersModule],
[{ focus: { user: { username: 'somebody' } } }] [{ focus: { user: { username: 'somebody' } } }]
); );
store.toggleFocusMode(false); store.toggleFocusMode(false);
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { framesModule as frames } from '../frames'; import { framesModule } from '../frames';
describe('sidebar/store/modules/frames', () => { describe('sidebar/store/modules/frames', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
// Setup a store for tests. // Setup a store for tests.
store = createStore([frames]); store = createStore([framesModule]);
}); });
describe('#connectFrame', () => { describe('#connectFrame', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { groups } from '../groups'; import { groupsModule } from '../groups';
import { session } from '../session'; import { sessionModule } from '../session';
import { immutable } from '../../../util/immutable'; import { immutable } from '../../../util/immutable';
describe('sidebar/store/modules/groups', () => { describe('sidebar/store/modules/groups', () => {
...@@ -73,7 +73,7 @@ describe('sidebar/store/modules/groups', () => { ...@@ -73,7 +73,7 @@ describe('sidebar/store/modules/groups', () => {
beforeEach(() => { beforeEach(() => {
// The empty second argument (settings) needed here because of the // The empty second argument (settings) needed here because of the
// dependency on the `session` module // dependency on the `session` module
store = createStore([groups, session], [{}]); store = createStore([groupsModule, sessionModule], [{}]);
}); });
describe('filterGroups', () => { describe('filterGroups', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { links } from '../links'; import { linksModule } from '../links';
describe('sidebar/store/modules/links', () => { describe('sidebar/store/modules/links', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([links]); store = createStore([linksModule]);
}); });
function addLinks() { function addLinks() {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { annotations } from '../annotations'; import { annotationsModule } from '../annotations';
import { groups } from '../groups'; import { groupsModule } from '../groups';
import { realTimeUpdates, $imports } from '../real-time-updates'; import { realTimeUpdatesModule, $imports } from '../real-time-updates';
import { selection } from '../selection'; import { selectionModule } from '../selection';
const { removeAnnotations } = annotations.actionCreators; const { removeAnnotations } = annotationsModule.actionCreators;
const { focusGroup } = groups.actionCreators; const { focusGroup } = groupsModule.actionCreators;
describe('sidebar/store/modules/real-time-updates', () => { describe('sidebar/store/modules/real-time-updates', () => {
let fakeAnnotationExists; let fakeAnnotationExists;
...@@ -31,18 +31,18 @@ describe('sidebar/store/modules/real-time-updates', () => { ...@@ -31,18 +31,18 @@ describe('sidebar/store/modules/real-time-updates', () => {
}); });
store = createStore( store = createStore(
[realTimeUpdates, annotations, selection], [realTimeUpdatesModule, annotationsModule, selectionModule],
[fakeSettings] [fakeSettings]
); );
$imports.$mock({ $imports.$mock({
'./annotations': { './annotations': {
annotations: { annotationsModule: {
selectors: { annotationExists: fakeAnnotationExists }, selectors: { annotationExists: fakeAnnotationExists },
}, },
}, },
'./groups': { './groups': {
groups: { groupsModule: {
selectors: { focusedGroupId: fakeFocusedGroupId }, selectors: { focusedGroupId: fakeFocusedGroupId },
}, },
}, },
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { routeModule as route } from '../route'; import { routeModule } from '../route';
describe('store/modules/route', () => { describe('store/modules/route', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([route]); store = createStore([routeModule]);
}); });
it('sets initial route to `null`', () => { it('sets initial route to `null`', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { annotations } from '../annotations'; import { annotationsModule } from '../annotations';
import { filters } from '../filters'; import { filtersModule } from '../filters';
import { selection } from '../selection'; import { selectionModule } from '../selection';
import { routeModule as route } from '../route'; import { routeModule } from '../route';
import * as fixtures from '../../../test/annotation-fixtures'; import * as fixtures from '../../../test/annotation-fixtures';
describe('sidebar/store/modules/selection', () => { describe('sidebar/store/modules/selection', () => {
...@@ -14,7 +14,10 @@ describe('sidebar/store/modules/selection', () => { ...@@ -14,7 +14,10 @@ describe('sidebar/store/modules/selection', () => {
}; };
beforeEach(() => { beforeEach(() => {
store = createStore([annotations, filters, selection, route], fakeSettings); store = createStore(
[annotationsModule, filtersModule, selectionModule, routeModule],
fakeSettings
);
}); });
describe('setForcedVisible', () => { describe('setForcedVisible', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { session } from '../session'; import { sessionModule } from '../session';
describe('sidebar/store/modules/session', () => { describe('sidebar/store/modules/session', () => {
let fakeSettings; let fakeSettings;
...@@ -7,7 +7,7 @@ describe('sidebar/store/modules/session', () => { ...@@ -7,7 +7,7 @@ describe('sidebar/store/modules/session', () => {
beforeEach(() => { beforeEach(() => {
fakeSettings = {}; fakeSettings = {};
store = createStore([session], [fakeSettings]); store = createStore([sessionModule], [fakeSettings]);
}); });
describe('#updateProfile', () => { describe('#updateProfile', () => {
...@@ -21,7 +21,7 @@ describe('sidebar/store/modules/session', () => { ...@@ -21,7 +21,7 @@ describe('sidebar/store/modules/session', () => {
describe('#defaultAuthority', () => { describe('#defaultAuthority', () => {
it('returns the default authority from the settings', () => { it('returns the default authority from the settings', () => {
fakeSettings.authDomain = 'foo.com'; fakeSettings.authDomain = 'foo.com';
store = createStore([session], [fakeSettings]); store = createStore([sessionModule], [fakeSettings]);
assert.equal(store.defaultAuthority(), 'foo.com'); assert.equal(store.defaultAuthority(), 'foo.com');
}); });
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { sidebarPanels } from '../sidebar-panels'; import { sidebarPanelsModule } from '../sidebar-panels';
describe('sidebar/store/modules/sidebar-panels', () => { describe('sidebar/store/modules/sidebar-panels', () => {
let store; let store;
...@@ -9,7 +9,7 @@ describe('sidebar/store/modules/sidebar-panels', () => { ...@@ -9,7 +9,7 @@ describe('sidebar/store/modules/sidebar-panels', () => {
}; };
beforeEach(() => { beforeEach(() => {
store = createStore([sidebarPanels]); store = createStore([sidebarPanelsModule]);
}); });
describe('#initialState', () => { describe('#initialState', () => {
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { toastMessages } from '../toast-messages'; import { toastMessagesModule } from '../toast-messages';
describe('store/modules/toast-messages', () => { describe('store/modules/toast-messages', () => {
let store; let store;
let fakeToastMessage; let fakeToastMessage;
beforeEach(() => { beforeEach(() => {
store = createStore([toastMessages]); store = createStore([toastMessagesModule]);
fakeToastMessage = { fakeToastMessage = {
id: 'myToast', id: 'myToast',
type: 'anyType', type: 'anyType',
......
import { createStore } from '../../create-store'; import { createStore } from '../../create-store';
import { viewer } from '../viewer'; import { viewerModule } from '../viewer';
describe('store/modules/viewer', () => { describe('store/modules/viewer', () => {
let store; let store;
beforeEach(() => { beforeEach(() => {
store = createStore([viewer]); store = createStore([viewerModule]);
}); });
describe('hasSidebarOpened', () => { describe('hasSidebarOpened', () => {
......
...@@ -112,7 +112,7 @@ function hasMessage(state, type, text) { ...@@ -112,7 +112,7 @@ function hasMessage(state, type, text) {
}); });
} }
export const toastMessages = createStoreModule(initialState, { export const toastMessagesModule = createStoreModule(initialState, {
namespace: 'toastMessages', namespace: 'toastMessages',
reducers, reducers,
actionCreators: { actionCreators: {
......
...@@ -43,7 +43,7 @@ function hasSidebarOpened(state) { ...@@ -43,7 +43,7 @@ function hasSidebarOpened(state) {
return state.sidebarHasOpened; return state.sidebarHasOpened;
} }
export const viewer = createStoreModule(initialState, { export const viewerModule = createStoreModule(initialState, {
namespace: 'viewer', namespace: 'viewer',
reducers, reducers,
actionCreators: { actionCreators: {
......
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