Skip to content

Commit e767abf

Browse files
Merge pull request #313 from topcoder-platform/feature/group-memberships
feature: add actions and reducers to fetch groups a member is a part of
2 parents 0fece44 + b72d035 commit e767abf

File tree

14 files changed

+4194
-4018
lines changed

14 files changed

+4194
-4018
lines changed

__tests__/__snapshots__/index.js.snap

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ exports[`Library interface test 1`] = `
44
Object {
55
"actions": Object {
66
"auth": Object {
7+
"getAuthenticatedMemberGroups": [Function],
78
"loadProfile": [Function],
89
"setTcTokenV2": [Function],
910
"setTcTokenV3": [Function],
@@ -53,6 +54,7 @@ Object {
5354
"dropGroups": [Function],
5455
"getGroupsDone": [Function],
5556
"getGroupsInit": [Function],
57+
"getMemberGroups": [Function],
5658
},
5759
"looker": Object {
5860
"getLookerDone": [Function],
@@ -403,6 +405,7 @@ Object {
403405
},
404406
"getApiResponsePayload": [Function],
405407
"getLookerApiResponsePayload": [Function],
408+
"handleApiResponse": [Function],
406409
},
407410
"time": Object {
408411
"default": undefined,

__tests__/reducers/auth.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@ const photoURL = 'http://url';
88
const mockActions = {
99
auth: {
1010
loadProfile: mockAction('LOAD_PROFILE', Promise.resolve('Profile')),
11+
getAuthenticatedMemberGroups: mockAction('GET_AUTHENTICATED_MEMBER_GROUPS', Promise.resolve(['Group'])),
1112
setTcTokenV2: mockAction('SET_TC_TOKEN_V2', 'Token V2'),
1213
setTcTokenV3: mockAction('SET_TC_TOKEN_V3', 'Token V3'),
1314
},
@@ -107,6 +108,7 @@ describe('Default reducer', () => {
107108
reducer = reducers.default;
108109
testReducer({
109110
authenticating: true,
111+
memberGroups: [],
110112
profile: null,
111113
tokenV2: '',
112114
tokenV3: '',
@@ -124,6 +126,7 @@ describe('Factory without server side rendering', () => {
124126

125127
testReducer({
126128
authenticating: true,
129+
memberGroups: [],
127130
profile: null,
128131
tokenV2: '',
129132
tokenV3: '',
@@ -145,6 +148,6 @@ describe('Factory with server side rendering', () => {
145148
});
146149

147150
testReducer({
148-
authenticating: false, user: 'User object', profile: 'Profile', tokenV2: 'Token V2', tokenV3: 'Token V3',
151+
authenticating: false, user: 'User object', profile: 'Profile', tokenV2: 'Token V2', tokenV3: 'Token V3', memberGroups: ['Group'],
149152
});
150153
});

0 commit comments

Comments
 (0)