Skip to content
Snippets Groups Projects
Commit dc1f085e authored by Chris Beer's avatar Chris Beer
Browse files

Update getWindowConfig to handle missing windows

parent 9c7725de
Branches
No related tags found
No related merge requests found
...@@ -24,6 +24,18 @@ describe('getWindowConfig', () => { ...@@ -24,6 +24,18 @@ describe('getWindowConfig', () => {
expect(getWindowConfig(state, { windowId: 'a' })).toEqual({ a: '1', b: '3', c: '4' }); expect(getWindowConfig(state, { windowId: 'a' })).toEqual({ a: '1', b: '3', c: '4' });
}); });
it('gracefully handles missing windows', () => {
const state = {
config: {
window: { a: '1', b: '2' },
},
windows: {
a: {},
},
};
expect(getWindowConfig(state, { windowId: 'c' })).toEqual({ a: '1', b: '2' });
});
}); });
describe('getMaximizedWindowsIds', () => { describe('getMaximizedWindowsIds', () => {
......
...@@ -10,7 +10,7 @@ import { getSequenceViewingHint, getSequenceBehaviors } from './sequences'; ...@@ -10,7 +10,7 @@ import { getSequenceViewingHint, getSequenceBehaviors } from './sequences';
/** */ /** */
export const getWindowConfig = createSelector( export const getWindowConfig = createSelector(
[getConfig, getWindow], [getConfig, getWindow],
({ window: defaultConfig }, windowConfig) => ({ ...defaultConfig, ...windowConfig }), ({ window: defaultConfig }, windowConfig = {}) => ({ ...defaultConfig, ...windowConfig }),
); );
/** /**
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment