@hedia/recommendation-screen 2.1.3 → 2.1.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (41) hide show
  1. package/coverage/clover.xml +11 -11
  2. package/coverage/coverage-final.json +3 -3
  3. package/coverage/lcov-report/index.html +3 -3
  4. package/coverage/lcov-report/src/RecommendationScreen.tsx.html +1 -1
  5. package/coverage/lcov-report/src/__tests__/index.html +1 -1
  6. package/coverage/lcov-report/src/__tests__/utils.tsx.html +2 -2
  7. package/coverage/lcov-report/src/components/Header.tsx.html +1 -1
  8. package/coverage/lcov-report/src/components/InfoBars.tsx.html +1 -1
  9. package/coverage/lcov-report/src/components/InvisibleNumberInput.tsx.html +1 -1
  10. package/coverage/lcov-report/src/components/LimitationMessage.tsx.html +1 -1
  11. package/coverage/lcov-report/src/components/LineSeparator.tsx.html +1 -1
  12. package/coverage/lcov-report/src/components/RecentInsulin.tsx.html +1 -1
  13. package/coverage/lcov-report/src/components/RecommendationModal.tsx.html +1 -1
  14. package/coverage/lcov-report/src/components/RecommendedCarbs.tsx.html +1 -1
  15. package/coverage/lcov-report/src/components/RecommendedInsulin.tsx.html +1 -1
  16. package/coverage/lcov-report/src/components/Remeasure.tsx.html +1 -1
  17. package/coverage/lcov-report/src/components/TransferToLogbook.tsx.html +1 -1
  18. package/coverage/lcov-report/src/components/TwoOptionModal.tsx.html +1 -1
  19. package/coverage/lcov-report/src/components/activity/Activity.tsx.html +1 -1
  20. package/coverage/lcov-report/src/components/activity/ActivityIcon.tsx.html +1 -1
  21. package/coverage/lcov-report/src/components/activity/ActivityIntensity.tsx.html +1 -1
  22. package/coverage/lcov-report/src/components/activity/index.html +1 -1
  23. package/coverage/lcov-report/src/components/index.html +1 -1
  24. package/coverage/lcov-report/src/components/mood/Emotion.tsx.html +1 -1
  25. package/coverage/lcov-report/src/components/mood/MoodIcon.tsx.html +1 -1
  26. package/coverage/lcov-report/src/components/mood/index.html +1 -1
  27. package/coverage/lcov-report/src/index.html +1 -1
  28. package/coverage/lcov-report/src/locale/i18nUtils.ts.html +1 -1
  29. package/coverage/lcov-report/src/locale/index.html +1 -1
  30. package/coverage/lcov-report/src/utils/AttentionMessages.tsx.html +1 -1
  31. package/coverage/lcov-report/src/utils/Constants.ts.html +1 -1
  32. package/coverage/lcov-report/src/utils/RecommendationError.tsx.html +4 -4
  33. package/coverage/lcov-report/src/utils/RecommendationUtils.ts.html +1 -1
  34. package/coverage/lcov-report/src/utils/Translations.ts.html +1 -1
  35. package/coverage/lcov-report/src/utils/Utils.ts.html +1 -1
  36. package/coverage/lcov-report/src/utils/Validations.ts.html +6 -6
  37. package/coverage/lcov-report/src/utils/index.html +3 -3
  38. package/coverage/lcov.info +73 -71
  39. package/package.json +1 -1
  40. package/src/__tests__/Validations.test.js +2 -1
  41. package/src/utils/Validations.js +2 -2
@@ -246,7 +246,7 @@ FNDA:91,getRecommendationProps
246
246
  FNDA:67,generateDefaultCalculatorParams
247
247
  FNDA:22,generateActivityProps
248
248
  FNDA:24,generateDefaultActivitySettings
249
- FNDA:97,generateDefaultLogbook
249
+ FNDA:98,generateDefaultLogbook
250
250
  FNDA:301,expectTextExists
251
251
  FNDA:26,queryTextFromComponent
252
252
  FNDA:93,expectTextNotExists
@@ -262,7 +262,7 @@ DA:20,91
262
262
  DA:45,67
263
263
  DA:66,22
264
264
  DA:75,24
265
- DA:84,97
265
+ DA:84,98
266
266
  DA:109,301
267
267
  DA:115,301
268
268
  DA:119,26
@@ -1060,7 +1060,7 @@ FN:141,(anonymous_21)
1060
1060
  FN:147,(anonymous_22)
1061
1061
  FNF:23
1062
1062
  FNH:23
1063
- FNDA:243,(anonymous_0)
1063
+ FNDA:244,(anonymous_0)
1064
1064
  FNDA:9,(anonymous_1)
1065
1065
  FNDA:12,(anonymous_2)
1066
1066
  FNDA:7,(anonymous_3)
@@ -1071,7 +1071,7 @@ FNDA:13,(anonymous_7)
1071
1071
  FNDA:12,(anonymous_8)
1072
1072
  FNDA:12,(anonymous_9)
1073
1073
  FNDA:24,(anonymous_10)
1074
- FNDA:12,(anonymous_11)
1074
+ FNDA:13,(anonymous_11)
1075
1075
  FNDA:12,(anonymous_12)
1076
1076
  FNDA:12,(anonymous_13)
1077
1077
  FNDA:6,(anonymous_14)
@@ -1084,8 +1084,8 @@ FNDA:9,(anonymous_20)
1084
1084
  FNDA:8,(anonymous_21)
1085
1085
  FNDA:7,(anonymous_22)
1086
1086
  DA:6,4
1087
- DA:12,243
1088
- DA:13,243
1087
+ DA:12,244
1088
+ DA:13,244
1089
1089
  DA:17,4
1090
1090
  DA:18,9
1091
1091
  DA:23,4
@@ -1107,7 +1107,7 @@ DA:68,12
1107
1107
  DA:73,4
1108
1108
  DA:74,24
1109
1109
  DA:79,4
1110
- DA:80,12
1110
+ DA:80,13
1111
1111
  DA:87,4
1112
1112
  DA:88,12
1113
1113
  DA:93,4
@@ -1404,7 +1404,7 @@ FNH:32
1404
1404
  FNDA:56,validateParams
1405
1405
  FNDA:61,checkBKProps
1406
1406
  FNDA:66,checkLanguage
1407
- FNDA:62,checkLatestLogbook6Hours
1407
+ FNDA:63,checkLatestLogbook6Hours
1408
1408
  FNDA:62,checkInjectionMethod
1409
1409
  FNDA:75,(anonymous_5)
1410
1410
  FNDA:61,checkBGLUnit
@@ -1450,9 +1450,9 @@ DA:67,61
1450
1450
  DA:68,2
1451
1451
  DA:73,66
1452
1452
  DA:74,5
1453
- DA:78,62
1453
+ DA:78,63
1454
1454
  DA:79,1
1455
- DA:81,61
1455
+ DA:81,62
1456
1456
  DA:82,60
1457
1457
  DA:83,4
1458
1458
  DA:89,62
@@ -1542,67 +1542,69 @@ BRDA:67,3,1,57
1542
1542
  BRDA:73,4,0,5
1543
1543
  BRDA:73,4,1,61
1544
1544
  BRDA:78,5,0,1
1545
- BRDA:78,5,1,61
1545
+ BRDA:78,5,1,62
1546
1546
  BRDA:81,6,0,60
1547
- BRDA:81,6,1,1
1548
- BRDA:82,7,0,4
1549
- BRDA:82,7,1,56
1550
- BRDA:92,8,0,3
1551
- BRDA:92,8,1,59
1552
- BRDA:99,9,0,3
1553
- BRDA:99,9,1,58
1554
- BRDA:104,10,0,60
1555
- BRDA:104,10,1,2
1556
- BRDA:106,11,0,3
1557
- BRDA:106,11,1,57
1558
- BRDA:113,12,0,4
1559
- BRDA:113,12,1,60
1560
- BRDA:131,13,0,7
1561
- BRDA:131,13,1,51
1562
- BRDA:141,14,0,2
1563
- BRDA:141,14,1,56
1564
- BRDA:141,15,0,58
1565
- BRDA:141,15,1,57
1566
- BRDA:148,16,0,3
1567
- BRDA:148,16,1,74
1568
- BRDA:156,17,0,3
1569
- BRDA:156,17,1,75
1570
- BRDA:163,18,0,4
1571
- BRDA:163,18,1,10
1572
- BRDA:172,19,0,4
1573
- BRDA:172,19,1,9
1574
- BRDA:179,20,0,5
1575
- BRDA:179,20,1,10
1576
- BRDA:188,21,0,3
1577
- BRDA:188,21,1,8
1578
- BRDA:199,22,0,11
1579
- BRDA:199,22,1,106
1580
- BRDA:199,23,0,117
1581
- BRDA:199,23,1,35
1582
- BRDA:200,24,0,1
1583
- BRDA:200,24,1,10
1584
- BRDA:200,25,0,11
1547
+ BRDA:81,6,1,2
1548
+ BRDA:81,7,0,62
1549
+ BRDA:81,7,1,61
1550
+ BRDA:82,8,0,4
1551
+ BRDA:82,8,1,56
1552
+ BRDA:92,9,0,3
1553
+ BRDA:92,9,1,59
1554
+ BRDA:99,10,0,3
1555
+ BRDA:99,10,1,58
1556
+ BRDA:104,11,0,60
1557
+ BRDA:104,11,1,2
1558
+ BRDA:106,12,0,3
1559
+ BRDA:106,12,1,57
1560
+ BRDA:113,13,0,4
1561
+ BRDA:113,13,1,60
1562
+ BRDA:131,14,0,7
1563
+ BRDA:131,14,1,51
1564
+ BRDA:141,15,0,2
1565
+ BRDA:141,15,1,56
1566
+ BRDA:141,16,0,58
1567
+ BRDA:141,16,1,57
1568
+ BRDA:148,17,0,3
1569
+ BRDA:148,17,1,74
1570
+ BRDA:156,18,0,3
1571
+ BRDA:156,18,1,75
1572
+ BRDA:163,19,0,4
1573
+ BRDA:163,19,1,10
1574
+ BRDA:172,20,0,4
1575
+ BRDA:172,20,1,9
1576
+ BRDA:179,21,0,5
1577
+ BRDA:179,21,1,10
1578
+ BRDA:188,22,0,3
1579
+ BRDA:188,22,1,8
1580
+ BRDA:199,23,0,11
1581
+ BRDA:199,23,1,106
1582
+ BRDA:199,24,0,117
1583
+ BRDA:199,24,1,35
1584
+ BRDA:200,25,0,1
1585
1585
  BRDA:200,25,1,10
1586
- BRDA:203,26,0,2
1587
- BRDA:203,26,1,104
1588
- BRDA:211,27,0,4
1589
- BRDA:211,27,1,10
1590
- BRDA:217,28,0,62
1591
- BRDA:217,28,1,2
1592
- BRDA:218,29,0,4
1593
- BRDA:218,29,1,58
1594
- BRDA:225,30,0,4
1595
- BRDA:225,30,1,60
1596
- BRDA:231,31,0,61
1597
- BRDA:231,31,1,3
1598
- BRDA:232,32,0,4
1599
- BRDA:232,32,1,57
1600
- BRDA:239,33,0,4
1601
- BRDA:239,33,1,60
1602
- BRDA:245,34,0,4
1603
- BRDA:245,34,1,60
1604
- BRDA:251,35,0,4
1605
- BRDA:251,35,1,60
1606
- BRF:72
1607
- BRH:72
1586
+ BRDA:200,26,0,11
1587
+ BRDA:200,26,1,10
1588
+ BRDA:203,27,0,2
1589
+ BRDA:203,27,1,104
1590
+ BRDA:211,28,0,4
1591
+ BRDA:211,28,1,10
1592
+ BRDA:217,29,0,62
1593
+ BRDA:217,29,1,2
1594
+ BRDA:218,30,0,4
1595
+ BRDA:218,30,1,58
1596
+ BRDA:225,31,0,4
1597
+ BRDA:225,31,1,60
1598
+ BRDA:231,32,0,61
1599
+ BRDA:231,32,1,3
1600
+ BRDA:232,33,0,4
1601
+ BRDA:232,33,1,57
1602
+ BRDA:239,34,0,4
1603
+ BRDA:239,34,1,60
1604
+ BRDA:245,35,0,4
1605
+ BRDA:245,35,1,60
1606
+ BRDA:251,36,0,4
1607
+ BRDA:251,36,1,60
1608
+ BRF:74
1609
+ BRH:74
1608
1610
  end_of_record
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@hedia/recommendation-screen",
3
- "version": "2.1.3",
3
+ "version": "2.1.5",
4
4
  "description": "Hedia Recommendation Screen for Bolus and Carbohydrates",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -96,6 +96,7 @@ describe(`Test validations functions for the recommendation props`, () => {
96
96
  validLatestLogbookFrom6Hours
97
97
  ${generateDefaultLogbook()}
98
98
  ${null}
99
+ ${{ ...generateDefaultLogbook(), blood_glucose_millimolar: null }}
99
100
  `(`Validation checking on the latest logbook from the latest 6 hours with a valid logbook`, ({ validLatestLogbookFrom6Hours }) => {
100
101
  expect(() => Validations.checkLatestLogbook6Hours(validLatestLogbookFrom6Hours)).not.toThrowError(Errors.LatestLogbook6HoursBGLError());
101
102
  });
@@ -177,7 +178,7 @@ describe(`Test validations for the calculator parameters`, () => {
177
178
  });
178
179
  test.each `
179
180
  invalidIntensity
180
- ${`Hard`}
181
+ ${`bingo`}
181
182
  ${`easy`}
182
183
  ${undefined}
183
184
  ${null}
@@ -33,7 +33,7 @@ export function checkLatestLogbook6Hours(logbook) {
33
33
  if (logbook === undefined) {
34
34
  throw LatestLogbook6HoursBGLError();
35
35
  }
36
- if (logbook !== null) {
36
+ if (logbook !== null && logbook.blood_glucose_millimolar !== null) {
37
37
  if (!Utils.isInRange(logbook.blood_glucose_millimolar, CURRENT_BGL_MMOL_LIMITS)) {
38
38
  throw LatestLogbook6HoursBGLError();
39
39
  }
@@ -109,7 +109,7 @@ export function checkActivityDuration(activityDuration) {
109
109
  }
110
110
  }
111
111
  export function checkActivityIntensity(activityIntensity) {
112
- const check = Object.values(Activity.Enums.ActivityIntensity).some((method) => method === activityIntensity);
112
+ const check = Object.values(Activity.Enums.ActivityIntensity).some((method) => method === activityIntensity?.toLowerCase());
113
113
  if (!check) {
114
114
  throw ActivityIntensityError();
115
115
  }