• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

RoundingWell / care-ops-frontend / 602ca7d4-4178-424f-af45-fe497fe9925f

11 Mar 2025 05:31PM UTC coverage: 98.19% (-1.8%) from 100.0%
602ca7d4-4178-424f-af45-fe497fe9925f

Pull #1403

circleci

paulfalgout
Refactor widget values to base widget
Pull Request #1403: Refactor widget values to base widget

1765 of 1819 branches covered (97.03%)

Branch coverage included in aggregate %.

8 of 8 new or added lines in 2 files covered. (100.0%)

90 existing lines in 17 files now uncovered.

6047 of 6137 relevant lines covered (98.53%)

2283.43 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

73.33
/src/js/utils/sorting.js
1
import { isNumber } from 'underscore';
2

3
// negates based on sort direction a sortable value
4
function sortByDir(sortDirection, sortableVal) {
5
  return (sortDirection === 'desc') ? (sortableVal * -1) : sortableVal;
23,196✔
6
}
7

8
function alphaSort(sortDir, a, b, nullVal = '') {
19,836✔
9
  if (!a) a = nullVal;
23,188✔
10
  if (!b) b = nullVal;
23,188✔
11
  return sortByDir(sortDir, a.localeCompare(b));
23,188✔
12
}
13

14
function getSortNum(val, defaultVal = -1) {
×
15
  return isNumber(val) ? val : defaultVal;
16!
16
}
17

18
function numSortBy(sortDir, val, nullVal) {
UNCOV
19
  const num = getSortNum(val, nullVal);
×
UNCOV
20
  return sortByDir(sortDir, num);
×
21
}
22

23
function numSort(sortDir, a, b, nullVal = Number.NEGATIVE_INFINITY) {
8✔
24
  if (!a) a = nullVal;
8✔
25
  if (!b) b = nullVal;
8!
26
  const sortVal = getSortNum(a, nullVal) > getSortNum(b, nullVal) ? 1 : -1;
8!
27
  return sortByDir(sortDir, sortVal);
8✔
28
}
29

30
function intSortBy(sortDir, val, nullVal) {
UNCOV
31
  const int = getSortNum(val, nullVal);
×
UNCOV
32
  return sortByDir(sortDir, parseInt(int, 10));
×
33
}
34

35
export {
36
  alphaSort,
37
  intSortBy,
38
  numSortBy,
39
  numSort,
40
};
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc