6
6
FINISH_FIRST_VISIT ,
7
7
UPDATE_CONNECTIVITY ,
8
8
UPDATE_DISPLAY_SETTINGS ,
9
- UPDATE_NAVIGATION_SETTINGS ,
9
+ UPDATE_NAVIGATION_SETTINGS
10
10
} from '../App.constants' ;
11
11
import appReducer from '../App.reducer' ;
12
12
@@ -24,9 +24,9 @@ describe('reducer', () => {
24
24
communicatorTour : {
25
25
isCommBoardsEnabled : true ,
26
26
isPublicBoardsEnabled : true ,
27
- isAllMyBoardsEnabled : true ,
27
+ isAllMyBoardsEnabled : true
28
28
} ,
29
- isAnalyticsTourEnabled : true ,
29
+ isAnalyticsTourEnabled : true
30
30
} ,
31
31
displaySettings : {
32
32
uiSize : DISPLAY_SIZE_STANDARD ,
@@ -35,7 +35,7 @@ describe('reducer', () => {
35
35
hideOutputActive : false ,
36
36
increaseOutputButtons : false ,
37
37
labelPosition : 'Below' ,
38
- darkThemeActive : false ,
38
+ darkThemeActive : false
39
39
} ,
40
40
navigationSettings : {
41
41
active : false ,
@@ -47,11 +47,12 @@ describe('reducer', () => {
47
47
quickUnlockActive : false ,
48
48
removeOutputActive : false ,
49
49
vocalizeFolders : false ,
50
+ improvePhraseActive : false
50
51
} ,
51
52
symbolsSettings : {
52
- arasaacActive : false ,
53
+ arasaacActive : false
53
54
} ,
54
- userData : { } ,
55
+ userData : { }
55
56
} ;
56
57
uData = { name :
'martin bedouret' , email :
'[email protected] ' } ;
57
58
mockApp = {
@@ -62,7 +63,7 @@ describe('reducer', () => {
62
63
labelPosition : 'Below' ,
63
64
fontFamily : DEFAULT_FONT_FAMILY ,
64
65
fontSize : 'Standard' ,
65
- darkThemeActive : false ,
66
+ darkThemeActive : false
66
67
} ,
67
68
isConnected : true ,
68
69
isFirstVisit : false ,
@@ -76,8 +77,9 @@ describe('reducer', () => {
76
77
quickUnlockActive : false ,
77
78
removeOutputActive : false ,
78
79
vocalizeFolders : false ,
80
+ improvePhraseActive : false
79
81
} ,
80
- userData : uData ,
82
+ userData : uData
81
83
} ;
82
84
} ) ;
83
85
it ( 'should return the initial state' , ( ) => {
@@ -86,57 +88,57 @@ describe('reducer', () => {
86
88
it ( 'should handle login ' , ( ) => {
87
89
const login = {
88
90
type : LOGIN_SUCCESS ,
89
- payload : uData ,
91
+ payload : uData
90
92
} ;
91
93
expect ( appReducer ( initialState , login ) ) . toEqual ( {
92
94
...initialState ,
93
95
userData : uData ,
94
- isFirstVisit : false ,
96
+ isFirstVisit : false
95
97
} ) ;
96
98
} ) ;
97
99
it ( 'should handle logout' , ( ) => {
98
100
const logout = {
99
- type : LOGOUT ,
101
+ type : LOGOUT
100
102
} ;
101
103
expect ( appReducer ( initialState , logout ) ) . toEqual ( initialState ) ;
102
104
} ) ;
103
105
it ( 'should handle updateDisplaySettings' , ( ) => {
104
106
const updateDisplaySettings = {
105
107
type : UPDATE_DISPLAY_SETTINGS ,
106
- payload : mockApp . displaySettings ,
108
+ payload : mockApp . displaySettings
107
109
} ;
108
110
expect ( appReducer ( initialState , updateDisplaySettings ) ) . toEqual ( {
109
111
...initialState ,
110
- displaySettings : mockApp . displaySettings ,
112
+ displaySettings : mockApp . displaySettings
111
113
} ) ;
112
114
} ) ;
113
115
it ( 'should handle updateNavigationSettings' , ( ) => {
114
116
const updateNavigationSettings = {
115
117
type : UPDATE_NAVIGATION_SETTINGS ,
116
- payload : mockApp . navigationSettings ,
118
+ payload : mockApp . navigationSettings
117
119
} ;
118
120
expect ( appReducer ( initialState , updateNavigationSettings ) ) . toEqual ( {
119
121
...initialState ,
120
- navigationSettings : mockApp . navigationSettings ,
122
+ navigationSettings : mockApp . navigationSettings
121
123
} ) ;
122
124
} ) ;
123
125
it ( 'should handle finishFirstVisit ' , ( ) => {
124
126
const finishFirstVisit = {
125
- type : FINISH_FIRST_VISIT ,
127
+ type : FINISH_FIRST_VISIT
126
128
} ;
127
129
expect ( appReducer ( initialState , finishFirstVisit ) ) . toEqual ( {
128
130
...initialState ,
129
- isFirstVisit : false ,
131
+ isFirstVisit : false
130
132
} ) ;
131
133
} ) ;
132
134
it ( 'should handle updateConnectivity' , ( ) => {
133
135
const updateConnectivity = {
134
136
type : UPDATE_CONNECTIVITY ,
135
- payload : false ,
137
+ payload : false
136
138
} ;
137
139
expect ( appReducer ( initialState , updateConnectivity ) ) . toEqual ( {
138
140
...initialState ,
139
- isConnected : false ,
141
+ isConnected : false
140
142
} ) ;
141
143
} ) ;
142
144
} ) ;
0 commit comments