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

MarkUsProject / Markus / 26761440669

01 Jun 2026 02:31PM UTC coverage: 90.193% (-0.08%) from 90.277%
26761440669

Pull #7968

github

web-flow
Merge c92a5051d into dace57810
Pull Request #7968: Fix navigation warnings on autotest manager and starter file manager pages, closes 7641

1027 of 2226 branches covered (46.14%)

Branch coverage included in aggregate %.

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

390 existing lines in 23 files now uncovered.

46153 of 50084 relevant lines covered (92.15%)

123.24 hits per line

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

85.11
/app/javascript/Components/Result/binary_viewer.jsx
1
import React from "react";
2

3
export class BinaryViewer extends React.PureComponent {
4
  constructor(props) {
5
    super(props);
7✔
6
    this.state = {
6✔
7
      content: null,
8
      getAnyway: false,
9
    };
10
    this.abortController = null;
6✔
11
  }
12

13
  componentDidMount() {
14
    // The URL has updated, so the content needs to be fetched using the new URL.
15
    this.fetchContent(this.props.url)
6✔
16
      .then(content =>
17
        this.setState({content: content}, () => this.props.setLoadingCallback(false))
4✔
18
      )
19
      .catch(error => {
20
        this.props.setLoadingCallback(false);
2✔
21
        if (error instanceof DOMException) return;
2!
22
        console.error(error);
2✔
23
      });
24
  }
25

26
  componentDidUpdate(prevProps, prevState) {
27
    if (this.props.url && this.props.url !== prevProps.url) {
10✔
28
      this.setState({getAnyway: false});
1✔
29
      this.fetchContent(this.props.url)
1✔
30
        .then(content =>
31
          this.setState({content: content}, () => this.props.setLoadingCallback(false))
1✔
32
        )
33
        .catch(error => {
UNCOV
34
          this.props.setLoadingCallback(false);
×
UNCOV
35
          if (error instanceof DOMException) return;
×
UNCOV
36
          console.error(error);
×
37
        });
38
    }
39
  }
40

41
  fetchContent(url) {
42
    if (this.abortController) {
7✔
43
      // Stops ongoing fetch requests. It's ok to call .abort() after the fetch has already completed,
44
      // fetch simply ignores it.
45
      this.abortController.abort();
1✔
46
    }
47
    // Reinitialize the controller, because the signal can't be reused after the request has been aborted.
48
    this.abortController = new AbortController();
7✔
49

50
    return fetch(url, {signal: this.abortController.signal})
7✔
51
      .then(response => {
52
        if (response.status === 413) {
6✔
53
          const errorMessage = I18n.t("submissions.oversize_submission_file");
1✔
54
          this.props.setErrorMessageCallback(errorMessage);
1✔
55
          throw new Error(errorMessage);
1✔
56
        } else {
57
          return response.text();
5✔
58
        }
59
      })
60
      .then(content => content.replace(/\r?\n/gm, "\n"));
5✔
61
  }
62

63
  componentWillUnmount() {
64
    if (this.abortController) {
6!
65
      this.abortController.abort();
6✔
66
    }
67
  }
68

69
  render() {
70
    return (
16✔
71
      <div>
72
        {!this.state.getAnyway && (
25✔
73
          <a onClick={() => this.setState({getAnyway: true})}>{I18n.t("submissions.get_anyway")}</a>
3✔
74
        )}
75
        {this.state.getAnyway && <p>{this.state.content}</p>}
23✔
76
      </div>
77
    );
78
  }
79
}
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