Commit f6479483 authored by Lyza Danger Gardner's avatar Lyza Danger Gardner

Add `directLinkedGroupFetchFailed` selector

Avoid accessing state via `getState()`
parent 0193c0ad
......@@ -136,6 +136,10 @@ function directLinkedGroupId(state) {
return state.directLinked.directLinkedGroupId;
}
function directLinkedGroupFetchFailed(state) {
return state.directLinked.directLinkedGroupFetchFailed;
}
export default {
init,
namespace: 'directLinked',
......@@ -149,6 +153,7 @@ export default {
},
selectors: {
directLinkedAnnotationId,
directLinkedGroupFetchFailed,
directLinkedGroupId,
},
};
......@@ -88,6 +88,13 @@ describe('sidebar/store/modules/direct-linked', () => {
});
});
describe('#directLinkedGroupFetchFailed', () => {
it('should return the group fetch failed status', () => {
store.setDirectLinkedGroupFetchFailed(true);
assert.isTrue(store.directLinkedGroupFetchFailed());
});
});
describe('#directLinkedGroupId', () => {
it('should return the current direct-linked group ID', () => {
store.setDirectLinkedGroupId('group-id');
......
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