@@ -73,7 +73,7 @@ describe('AccountLists', () => {
73
73
</ ThemeProvider > ,
74
74
) ;
75
75
expect ( getByRole ( 'link' ) ) . toHaveTextContent (
76
- 'AccountGoal$1,000*Gifts Started60%Committed80%*Last updated Jan 1, 2024 ' ,
76
+ 'AccountGoal$1,000*Gifts Started60%Committed80%*Below machine-calculated goal ' ,
77
77
) ;
78
78
} ) ;
79
79
@@ -167,7 +167,7 @@ describe('AccountLists', () => {
167
167
</ ThemeProvider > ,
168
168
) ;
169
169
expect ( getByRole ( 'link' ) ) . toHaveTextContent (
170
- 'AccountGoal€2,000*Gifts Started-Committed-*machine-calculated ' ,
170
+ 'AccountGifts Started-Committed-' ,
171
171
) ;
172
172
} ) ;
173
173
@@ -211,4 +211,60 @@ describe('AccountLists', () => {
211
211
expect ( queryByText ( 'Last updated Dec 30, 2019' ) ) . not . toBeInTheDocument ( ) ;
212
212
} ) ;
213
213
} ) ;
214
+
215
+ describe ( 'below machine-calculated warning' , ( ) => {
216
+ it ( 'is shown if goal is less than the machine-calculated goal' , ( ) => {
217
+ const data = gqlMock < GetAccountListsQuery > ( GetAccountListsDocument , {
218
+ mocks : {
219
+ accountLists : {
220
+ nodes : [
221
+ {
222
+ currency : 'USD' ,
223
+ monthlyGoal : 5000 ,
224
+ healthIndicatorData : {
225
+ machineCalculatedGoal : 10000 ,
226
+ machineCalculatedGoalCurrency : 'USD' ,
227
+ } ,
228
+ } ,
229
+ ] ,
230
+ } ,
231
+ } ,
232
+ } ) ;
233
+
234
+ const { getByText } = render (
235
+ < ThemeProvider theme = { theme } >
236
+ < AccountLists data = { data } />
237
+ </ ThemeProvider > ,
238
+ ) ;
239
+ expect ( getByText ( 'Below machine-calculated goal' ) ) . toBeInTheDocument ( ) ;
240
+ } ) ;
241
+
242
+ it ( 'is hidden if goal is greater than or equal to the machine-calculated goal' , async ( ) => {
243
+ const data = gqlMock < GetAccountListsQuery > ( GetAccountListsDocument , {
244
+ mocks : {
245
+ accountLists : {
246
+ nodes : [
247
+ {
248
+ currency : 'USD' ,
249
+ monthlyGoal : 5000 ,
250
+ healthIndicatorData : {
251
+ machineCalculatedGoal : 5000 ,
252
+ machineCalculatedGoalCurrency : 'USD' ,
253
+ } ,
254
+ } ,
255
+ ] ,
256
+ } ,
257
+ } ,
258
+ } ) ;
259
+
260
+ const { queryByText } = render (
261
+ < ThemeProvider theme = { theme } >
262
+ < AccountLists data = { data } />
263
+ </ ThemeProvider > ,
264
+ ) ;
265
+ expect (
266
+ queryByText ( 'Below machine-calculated goal' ) ,
267
+ ) . not . toBeInTheDocument ( ) ;
268
+ } ) ;
269
+ } ) ;
214
270
} ) ;
0 commit comments