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

FAIRsharing / fairsharing.github.io / 25375283965

05 May 2026 12:05PM UTC coverage: 96.181% (+0.3%) from 95.902%
25375283965

Pull #2761

github

prakhyatox
adding tests for Users/Profiles/Private/ViewSavedSearchesTable.vue to increase coverage
Pull Request #2761: Fix multiple display additional test 2758

3654 of 3822 branches covered (95.6%)

Branch coverage included in aggregate %.

122 of 129 new or added lines in 5 files covered. (94.57%)

42 existing lines in 1 file now uncovered.

38808 of 40326 relevant lines covered (96.24%)

5.46 hits per line

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

95.83
/src/utils/stringUtils.js
1
const stringUtils = {
1✔
2
  methods: {
1✔
3
    cleanString(string) {
1✔
4
      if (typeof string === "string") {
416✔
5
        if (string.includes("_")) {
414✔
6
          return string.replace(/_/g, " ");
33✔
7
        }
33✔
8
      }
414✔
9
      return string;
383✔
10
    },
1✔
11
    prettifyList(string) {
1✔
12
      return string.replace(/,/g, ", ");
1✔
13
    },
1✔
14
    truncate(str, n) {
1✔
15
      return str.length > n ? str.substr(0, n - 1) + "..." : str;
4✔
16
    },
1✔
17
    toHyperLink(str) {
1✔
18
      let link;
1✔
19
      let pattern1 =
1✔
20
        /(\b(https?|ftp|file):\/\/[-A-Z0-9+&@#/%?=~_|!:,.;]*[-A-Z0-9+&@#/%=~_|])/gi;
1✔
21
      if (pattern1.test(str)) {
1✔
22
        link = str.replace(
1✔
23
          pattern1,
1✔
24
          '<a href="$1" target="_blank" rel="noopener noreferrer">$1</a>',
1✔
25
        );
1✔
26
      } else {
1!
NEW
27
        link = str;
×
NEW
28
      }
×
29
      return link;
1✔
30
    },
1✔
31
  },
1✔
32
  filters: {
1✔
33
    pretty(val) {
1✔
34
      return JSON.stringify(val)
1✔
35
        .replace(/,/g, "<br/>") // commas -> newlines
1✔
36
        .replace(/\{|\}|\[|\]/g, "") // remove brackets
1✔
37
        .replace(/"/g, "") // remove quotes
1✔
38
        .replace(/:/g, ": "); // add a space after a colon
1✔
39
    },
1✔
40
  },
1✔
41
};
1✔
42

43
// Removed from Organisation.vue, but I've not deleted it in case it is needed again.
1✔
44
/*
1✔
45
export const formatList = {
1✔
46
    filters: {
1✔
47
        formatList: function(list) {
1✔
48
            const lf = new Intl.ListFormat('en');
1✔
49
            return lf.format(list);
1✔
50
        }
1✔
51
    }
1✔
52
}
1✔
53
 */
1✔
54

55
export default stringUtils;
1✔
56

57
export const truncate = {
1✔
58
  methods: {
1✔
59
    truncate(str, n) {
1✔
60
      return stringUtils.methods.truncate(str, n);
2✔
61
    },
1✔
62
  },
1✔
63
};
1✔
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