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

electron / fiddle / b0a3b3ae-4f94-4745-a6f0-9aa32b229ed3

31 Aug 2023 06:50PM CUT coverage: 87.103% (-1.0%) from 88.082%
b0a3b3ae-4f94-4745-a6f0-9aa32b229ed3

Pull #1452

circleci

dsanders11
test: fix error in CI
Pull Request #1452: refactor: move fiddle-core usage to main process

945 of 1183 branches covered (0.0%)

Branch coverage included in aggregate %.

106 of 106 new or added lines in 7 files covered. (100.0%)

3668 of 4113 relevant lines covered (89.18%)

31.58 hits per line

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

0.0
/src/renderer/components/output-editors-wrapper.tsx
1
import * as React from 'react';
×
2

3
import { reaction } from 'mobx';
×
4
import { Mosaic, MosaicNode, MosaicParent } from 'react-mosaic-component';
×
5

6
import { Editors } from './editors';
×
7
import { Outputs } from './outputs';
×
8
import { Sidebar } from './sidebar';
×
9
import { AppState } from '../state';
10

11
interface WrapperProps {
12
  appState: AppState;
13
}
14

15
interface WrapperState {
16
  mosaic: MosaicNode<WrapperEditorId>;
17
  focusable: boolean;
18
}
19

20
export type WrapperEditorId = 'output' | 'editors' | 'sidebar';
21

22
export class OutputEditorsWrapper extends React.Component<
×
23
  WrapperProps,
24
  WrapperState
25
> {
26
  private MOSAIC_ELEMENTS = {
×
27
    output: <Outputs appState={this.props.appState} />,
28
    editors: <Editors appState={this.props.appState} />,
29
    sidebar: <Sidebar appState={this.props.appState} />,
30
  };
31

32
  constructor(props: any) {
33
    super(props);
×
34
    this.state = {
×
35
      mosaic: {
36
        direction: 'column',
37
        first: 'output',
38
        second: {
39
          direction: 'row',
40
          first: 'sidebar',
41
          second: 'editors',
42
          splitPercentage: 15,
43
        },
44
        splitPercentage: 25,
45
      },
46
      focusable: true,
47
    };
48
    reaction(
×
49
      () => this.props.appState.isSettingsShowing,
×
50
      (isSettingsShowing) => this.setState({ focusable: !isSettingsShowing }),
×
51
    );
52
  }
53

54
  public render() {
55
    return (
×
56
      <Mosaic<WrapperEditorId>
57
        renderTile={(id: string) =>
58
          this.MOSAIC_ELEMENTS[id as keyof typeof this.MOSAIC_ELEMENTS]
×
59
        }
60
        resize={{ minimumPaneSizePercentage: 15 }}
61
        value={this.state.mosaic}
62
        onChange={this.onChange}
63
        className={!this.state.focusable ? 'tabbing-hidden' : undefined}
×
64
      />
65
    );
66
  }
67

68
  private onChange = (rootNode: MosaicParent<WrapperEditorId>) => {
×
69
    const isConsoleShowing = rootNode.splitPercentage !== 0;
×
70

71
    if (isConsoleShowing !== this.props.appState.isConsoleShowing) {
×
72
      this.props.appState.isConsoleShowing = isConsoleShowing;
×
73
    }
74
    this.setState({ mosaic: rootNode });
×
75
  };
76
}
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

© 2025 Coveralls, Inc