@@ -19,7 +19,7 @@ import { usersReducer } from '.';
1919
2020describe ( 'Establishments reducer' , ( ) => {
2121 const initialState = {
22- list : [ ] ,
22+ data : [ ] ,
2323 loading : false ,
2424 error : null ,
2525 success : false ,
@@ -47,7 +47,7 @@ describe('Establishments reducer', () => {
4747 } ) ;
4848 } ) ;
4949
50- it ( 'should set error to null, loading to false and list with the corresponding values when USERS_FETCH_DATA_SUCCESS actions is fired' , ( ) => {
50+ it ( 'should set error to null, loading to false and data with the corresponding values when USERS_FETCH_DATA_SUCCESS actions is fired' , ( ) => {
5151 const userData = [
5252 {
5353 name : 'Test name' ,
@@ -57,26 +57,26 @@ describe('Establishments reducer', () => {
5757 } ,
5858 ] ;
5959
60- reducerTest ( initialState , USERS_FETCH_DATA_SUCCESS ( { list : userData } ) , {
60+ reducerTest ( initialState , USERS_FETCH_DATA_SUCCESS ( { data : userData } ) , {
6161 ...initialState ,
62- list : userData ,
62+ data : userData ,
6363 loading : false ,
6464 error : null ,
6565 } ) ;
6666 } ) ;
6767
6868 it ( 'should set error to null, loading to false and user with the corresponding values when USERS_FETCH_DATA_SUCCESS actions is fired' , ( ) => {
69- const list = [
69+ const data = [
7070 {
7171 name : 'Test name' ,
7272 email : 'Test email' ,
7373 location : 'Test location' ,
7474 createdAt : '11/20/2020' ,
7575 } ,
7676 ] ;
77- reducerTest ( initialState , USERS_FETCH_DATA_SUCCESS ( { list } ) , {
77+ reducerTest ( initialState , USERS_FETCH_DATA_SUCCESS ( { data } ) , {
7878 ...initialState ,
79- list ,
79+ data ,
8080 loading : false ,
8181 error : null ,
8282 } ) ;
@@ -93,7 +93,7 @@ describe('Establishments reducer', () => {
9393 const user = { id : 'exampleId' } ;
9494
9595 reducerTest (
96- { ...initialState , list : [ user ] } ,
96+ { ...initialState , data : [ user ] } ,
9797 USERS_DELETE_USER_SUCCESS ( { id : 'exampleId' } ) ,
9898 { ...initialState , error : null , loading : false , deleted : true }
9999 ) ;
@@ -129,7 +129,7 @@ describe('Establishments reducer', () => {
129129
130130 reducerTest ( initialState , USERS_CREATE_USER_SUCCESS ( { user } ) , {
131131 ...initialState ,
132- list : user ,
132+ data : user ,
133133 success : true ,
134134 } ) ;
135135 } ) ;
@@ -170,14 +170,14 @@ describe('Establishments reducer', () => {
170170 } ;
171171
172172 reducerTest (
173- { ...initialState , list : initialUsers } ,
173+ { ...initialState , data : initialUsers } ,
174174 USERS_MODIFY_USER_SUCCESS ( {
175175 user : resultUser ,
176176 id : 'test id' ,
177177 } ) ,
178178 {
179179 ...initialState ,
180- list : [ resultUser ] ,
180+ data : [ resultUser ] ,
181181 loading : false ,
182182 error : null ,
183183 success : true ,
0 commit comments