@@ -106,6 +106,7 @@ describe('UserEffects', () => {
106106 } ) ;
107107 } ) ;
108108
109+ < < < << << HEAD
109110< << << << HEAD
110111 it ( 'action type is ADD_USER_TO_GROUP_SUCCESS when service is executed sucessfully' , async ( ) => {
111112 const userId = 'userId' ;
@@ -119,11 +120,19 @@ describe('UserEffects', () => {
119120 actions$ = of ( {
120121 type : UserActionTypes . ADD_GROUP_TO_USER ,
121122> >>> >>> feat : TT - 188 add ngrx flow & test
123+ === = ===
124+ it ( 'action type is ADD_USER_TO_GROUP_SUCCESS when service is executed sucessfully' , async ( ) => {
125+ const userId = 'userId' ;
126+ const groupName = 'groupName' ;
127+ actions$ = of ( {
128+ type : UserActionTypes . ADD_USER_TO_GROUP ,
129+ > >>> >>> refactor : TT - 188 refactor some names
122130 userId ,
123131 groupName,
124132 } ) ;
125133
126134 spyOn ( toastrService , 'success' ) ;
135+ < < < << << HEAD
127136< << << << HEAD
128137 spyOn ( service , 'addUserToGroup' ) . and . returnValue ( of ( user ) ) ;
129138
@@ -140,24 +149,32 @@ describe('UserEffects', () => {
140149 type : UserActionTypes . ADD_USER_TO_GROUP ,
141150= === ===
142151 spyOn ( service , 'addGroupToUser' ) . and . returnValue ( of ( user ) ) ;
152+ === = ===
153+ spyOn ( service , 'addUserToGroup' ) . and . returnValue ( of ( user ) ) ;
154+ >>> > >>> refactor : TT - 188 refactor some names
143155
144- effects . addGroupToUser $. subscribe ( ( action ) => {
145- expect ( toastrService . success ) . toHaveBeenCalledWith ( 'Add group to a user success' ) ;
146- expect ( action . type ) . toEqual ( UserActionTypes . ADD_GROUP_TO_USER_SUCCESS ) ;
156+ effects . addUserToGroup $. subscribe ( ( action ) => {
157+ expect ( toastrService . success ) . toHaveBeenCalledWith ( 'Add user to group success' ) ;
158+ expect ( action . type ) . toEqual ( UserActionTypes . ADD_USER_TO_GROUP_SUCCESS ) ;
147159 } ) ;
148160 } ) ;
149161
150- it ( 'action type is ADD_GROUP_TO_USER_FAIL when service is executed and fail' , async ( ) => {
162+ it ( 'action type is ADD_USER_TO_GROUP_FAIL when service is executed and fail' , async ( ) => {
151163 const userId = 'userId' ;
152164 const groupName = 'groupName' ;
153165 actions$ = of ( {
166+ < << << << HEAD
154167 type: UserActionTypes . ADD_GROUP_TO_USER ,
155168> >>> >>> feat : TT - 188 add ngrx flow & test
169+ === = ===
170+ type : UserActionTypes . ADD_USER_TO_GROUP ,
171+ > >>> >>> refactor : TT - 188 refactor some names
156172 userId ,
157173 groupName ,
158174 } ) ;
159175
160176 spyOn ( toastrService , 'error' ) ;
177+ < < < << << HEAD
161178< << << << HEAD
162179 spyOn ( service , 'addUserToGroup' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
163180
@@ -174,24 +191,32 @@ describe('UserEffects', () => {
174191 type : UserActionTypes . REMOVE_USER_FROM_GROUP ,
175192= === ===
176193 spyOn ( service , 'addGroupToUser' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
194+ === = ===
195+ spyOn ( service , 'addUserToGroup' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
196+ >>> > >>> refactor : TT - 188 refactor some names
177197
178- effects . addGroupToUser $. subscribe ( ( action ) => {
198+ effects . addUserToGroup $. subscribe ( ( action ) => {
179199 expect ( toastrService . error ) . toHaveBeenCalled ( ) ;
180- expect ( action . type ) . toEqual ( UserActionTypes . ADD_GROUP_TO_USER_FAIL ) ;
200+ expect ( action . type ) . toEqual ( UserActionTypes . ADD_USER_TO_GROUP_FAIL ) ;
181201 } ) ;
182202 } ) ;
183203
184- it ( 'action type is REMOVE_GROUP_TO_USER_SUCCESS when service is executed succesfully' , async ( ) => {
204+ it ( 'action type is REMOVE_USER_TO_GROUP_SUCCESS when service is executed succesfully' , async ( ) => {
185205 const userId = 'userId' ;
186206 const groupName = 'groupName' ;
187207 actions$ = of ( {
208+ < << << << HEAD
188209 type: UserActionTypes . REMOVE_GROUP_TO_USER ,
189210> >>> >>> feat : TT - 188 add ngrx flow & test
211+ === = ===
212+ type : UserActionTypes . REMOVE_USER_TO_GROUP ,
213+ > >>> >>> refactor : TT - 188 refactor some names
190214 userId ,
191215 groupName ,
192216 } ) ;
193217
194218 spyOn ( toastrService , 'success' ) ;
219+ < < < << << HEAD
195220< << << << HEAD
196221 spyOn ( service , 'removeUserFromGroup' ) . and . returnValue ( of ( user ) ) ;
197222
@@ -208,24 +233,32 @@ describe('UserEffects', () => {
208233 type : UserActionTypes . REMOVE_USER_FROM_GROUP ,
209234= === ===
210235 spyOn ( service , 'removeGroupToUser' ) . and . returnValue ( of ( user ) ) ;
236+ === = ===
237+ spyOn ( service , 'removeUserToGroup' ) . and . returnValue ( of ( user ) ) ;
238+ >>> > >>> refactor : TT - 188 refactor some names
211239
212- effects . removeGroupToUser $. subscribe ( ( action ) => {
213- expect ( toastrService . success ) . toHaveBeenCalledWith ( 'Remove group to a user success' ) ;
214- expect ( action . type ) . toEqual ( UserActionTypes . REMOVE_GROUP_TO_USER_SUCCESS ) ;
240+ effects . removeUserToGroup $. subscribe ( ( action ) => {
241+ expect ( toastrService . success ) . toHaveBeenCalledWith ( 'Remove user to group success' ) ;
242+ expect ( action . type ) . toEqual ( UserActionTypes . REMOVE_USER_TO_GROUP_SUCCESS ) ;
215243 } ) ;
216244 } ) ;
217245
218- it ( 'action type is REMOVE_GROUP_TO_USER_FAIL when service is executed succesfully' , async ( ) => {
246+ it ( 'action type is REMOVE_USER_TO_GROUP_FAIL when service is executed succesfully' , async ( ) => {
219247 const userId = 'userId' ;
220248 const groupName = 'groupName' ;
221249 actions$ = of ( {
250+ < << << << HEAD
222251 type: UserActionTypes . REMOVE_GROUP_TO_USER ,
223252> >>> >>> feat : TT - 188 add ngrx flow & test
253+ === = ===
254+ type : UserActionTypes . REMOVE_USER_TO_GROUP ,
255+ > >>> >>> refactor : TT - 188 refactor some names
224256 userId ,
225257 groupName ,
226258 } ) ;
227259
228260 spyOn ( toastrService , 'error' ) ;
261+ < < < << << HEAD
229262< << << << HEAD
230263 spyOn ( service , 'removeUserFromGroup' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
231264
@@ -234,11 +267,18 @@ describe('UserEffects', () => {
234267 expect ( action . type ) . toEqual ( UserActionTypes . REMOVE_USER_FROM_GROUP_FAIL ) ;
235268= === ===
236269 spyOn ( service , 'removeGroupToUser' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
270+ = === ===
271+ spyOn ( service , 'removeUserToGroup' ) . and . returnValue ( throwError ( { error : { message : 'error' } } ) ) ;
272+ > >>> >>> refactor: TT - 188 refactor some names
237273
238- effects . removeGroupToUser $. subscribe ( ( action ) => {
274+ effects . removeUserToGroup $. subscribe ( ( action ) => {
239275 expect ( toastrService . error ) . toHaveBeenCalled ( ) ;
276+ < < < << << HEAD
240277 expect ( action . type ) . toEqual ( UserActionTypes . REMOVE_GROUP_TO_USER_FAIL ) ;
241278>>> >>> > feat : TT - 188 add ngrx flow & test
279+ === = ===
280+ expect ( action . type ) . toEqual ( UserActionTypes . REMOVE_USER_TO_GROUP_FAIL ) ;
281+ > >>> >>> refactor: TT - 188 refactor some names
242282 } ) ;
243283 } ) ;
244284} ) ;
0 commit comments