@@ -1263,6 +1263,110 @@ describe('Report Step', () => {
1263
1263
} ) ;
1264
1264
} ) ;
1265
1265
1266
+ it ( 'should show classification chart when click switch model button and story points sum is zero' , async ( ) => {
1267
+ const mockReportData = { ...MOCK_REPORT_MOCK_PIPELINE_RESPONSE } ;
1268
+ mockReportData . classificationList = [
1269
+ {
1270
+ fieldName : 'Issue Type' ,
1271
+ totalCardCount : 3 ,
1272
+ storyPoints : 0 ,
1273
+ classificationInfos : [
1274
+ {
1275
+ name : 'Feature Work - Planned' ,
1276
+ cardCountValue : 0.5714 ,
1277
+ cardCount : 1 ,
1278
+ storyPoints : 0 ,
1279
+ storyPointsValue : 0 ,
1280
+ } ,
1281
+ {
1282
+ name : 'Feature Work - Planned2' ,
1283
+ cardCountValue : 0.5714 ,
1284
+ cardCount : 2 ,
1285
+ storyPoints : 0 ,
1286
+ storyPointsValue : 0 ,
1287
+ } ,
1288
+ ] ,
1289
+ } ,
1290
+ {
1291
+ fieldName : 'Parent' ,
1292
+ totalCardCount : 3 ,
1293
+ storyPoints : 0 ,
1294
+ classificationInfos : [
1295
+ {
1296
+ name : 'Feature Work - Planned' ,
1297
+ cardCountValue : 0.5714 ,
1298
+ cardCount : 3 ,
1299
+ storyPoints : 0 ,
1300
+ storyPointsValue : 0 ,
1301
+ } ,
1302
+ {
1303
+ name : 'Feature Work - Planned2' ,
1304
+ cardCountValue : 0.5714 ,
1305
+ cardCount : 2 ,
1306
+ storyPoints : 0 ,
1307
+ storyPointsValue : 0 ,
1308
+ } ,
1309
+ ] ,
1310
+ } ,
1311
+ ] ;
1312
+
1313
+ reportHook . current . reportInfos [ 0 ] . reportData = mockReportData ;
1314
+
1315
+ setup ( REQUIRED_DATA_LIST , [ fullValueDateRange , emptyValueDateRange ] ) ;
1316
+
1317
+ const switchChartButton = screen . getByText ( DISPLAY_TYPE . CHART ) ;
1318
+ await userEvent . click ( switchChartButton ) ;
1319
+
1320
+ const issueTypeSwitchButtonGroup = screen . queryByLabelText ( 'classification issue type switch model button group' ) ;
1321
+ const issueTypeSwitchCardCountButton = screen . queryByLabelText (
1322
+ 'classification issue type switch card count model button' ,
1323
+ ) ;
1324
+ const issueTypeSwitchStoryPointsGroup = screen . queryByLabelText (
1325
+ 'classification issue type switch story points model button' ,
1326
+ ) ;
1327
+ const parentSwitchButtonGroup = screen . queryByLabelText ( 'classification parent switch model button group' ) ;
1328
+ const parentSwitchCardCountButton = screen . queryByLabelText (
1329
+ 'classification parent switch card count model button' ,
1330
+ ) ;
1331
+ const parentSwitchStoryPointsButton = screen . queryByLabelText (
1332
+ 'classification parent switch story points model button' ,
1333
+ ) ;
1334
+
1335
+ const classificationIssueTypeChart = screen . queryByLabelText ( 'classification issue type chart' ) ;
1336
+ const classificationIssueTypeSwitchIcon = screen . queryByLabelText ( 'classification issue type switch chart' ) ;
1337
+ const classificationParentChart = screen . queryByLabelText ( 'classification parent chart' ) ;
1338
+ const classificationParentSwitchIcon = screen . queryByLabelText ( 'classification parent switch chart' ) ;
1339
+
1340
+ expect ( issueTypeSwitchButtonGroup ) . toBeInTheDocument ( ) ;
1341
+ expect ( issueTypeSwitchCardCountButton ) . toBeInTheDocument ( ) ;
1342
+ expect ( issueTypeSwitchStoryPointsGroup ) . toBeInTheDocument ( ) ;
1343
+ expect ( parentSwitchButtonGroup ) . toBeInTheDocument ( ) ;
1344
+ expect ( parentSwitchCardCountButton ) . toBeInTheDocument ( ) ;
1345
+ expect ( parentSwitchStoryPointsButton ) . toBeInTheDocument ( ) ;
1346
+
1347
+ expect ( classificationIssueTypeChart ) . toBeInTheDocument ( ) ;
1348
+ expect ( classificationIssueTypeSwitchIcon ) . toBeInTheDocument ( ) ;
1349
+ expect ( classificationParentChart ) . toBeInTheDocument ( ) ;
1350
+ expect ( classificationParentSwitchIcon ) . toBeInTheDocument ( ) ;
1351
+
1352
+ await userEvent . click ( issueTypeSwitchCardCountButton ! ) ;
1353
+ await userEvent . click ( issueTypeSwitchStoryPointsGroup ! ) ;
1354
+ await userEvent . click ( parentSwitchCardCountButton ! ) ;
1355
+ await userEvent . click ( parentSwitchStoryPointsButton ! ) ;
1356
+
1357
+ await userEvent . click ( classificationIssueTypeSwitchIcon ! ) ;
1358
+ await userEvent . click ( classificationParentSwitchIcon ! ) ;
1359
+
1360
+ const wait = ( ms : number ) => new Promise ( ( resolve ) => setTimeout ( resolve , ms ) ) ;
1361
+ await wait ( 1500 ) ;
1362
+ await waitFor ( async ( ) => {
1363
+ const setOptionCalledTimes = chart . setOption . mock . calls . length ;
1364
+ const clearCalledTimes = chart . clear . mock . calls . length ;
1365
+ expect ( setOptionCalledTimes ) . toBeGreaterThan ( 18 ) ;
1366
+ expect ( clearCalledTimes ) . toBeGreaterThan ( 18 ) ;
1367
+ } ) ;
1368
+ } ) ;
1369
+
1266
1370
it ( 'should render dora chart with empty value when exception was thrown' , async ( ) => {
1267
1371
reportHook . current . reportInfos = [
1268
1372
{
0 commit comments