html-reporter 9.9.2 → 9.10.0

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 (34) hide show
  1. package/CHANGELOG.md +10 -0
  2. package/lib/common-utils.js +6 -0
  3. package/lib/constants/checked-statuses.js +7 -0
  4. package/lib/static/components/bullet.js +30 -0
  5. package/lib/static/components/controls/common-filters.js +4 -2
  6. package/lib/static/components/controls/gui-controls.js +4 -39
  7. package/lib/static/components/controls/run-button/index.js +129 -0
  8. package/lib/static/components/controls/run-button/index.styl +49 -0
  9. package/lib/static/components/controls/show-checkboxes-input.js +24 -0
  10. package/lib/static/components/controls/strict-match-filter-input.js +1 -1
  11. package/lib/static/components/group-tests/item.js +58 -31
  12. package/lib/static/components/popup/index.js +6 -2
  13. package/lib/static/components/popup/index.styl +39 -33
  14. package/lib/static/components/section/section-browser.js +1 -1
  15. package/lib/static/components/section/title/browser-skipped.js +32 -15
  16. package/lib/static/components/section/title/browser.js +49 -42
  17. package/lib/static/components/section/title/simple.js +59 -55
  18. package/lib/static/gui.css +40 -24
  19. package/lib/static/gui.min.css +1 -1
  20. package/lib/static/gui.min.js +17 -17
  21. package/lib/static/hooks/useLocalStorage.js +39 -0
  22. package/lib/static/modules/action-names.js +4 -1
  23. package/lib/static/modules/actions.js +4 -1
  24. package/lib/static/modules/reducers/tree/helpers.js +16 -0
  25. package/lib/static/modules/reducers/tree/index.js +58 -3
  26. package/lib/static/modules/reducers/tree/nodes/browsers.js +8 -1
  27. package/lib/static/modules/reducers/tree/nodes/suites.js +36 -4
  28. package/lib/static/modules/selectors/tree.js +13 -0
  29. package/lib/static/report.min.css +1 -1
  30. package/lib/static/report.min.js +17 -17
  31. package/lib/static/styles.css +64 -14
  32. package/package.json +1 -1
  33. package/2html-reporter.iml +0 -9
  34. package/lib/static/components/controls/run-button.js +0 -27
package/CHANGELOG.md CHANGED
@@ -2,6 +2,16 @@
2
2
 
3
3
  All notable changes to this project will be documented in this file. See [standard-version](https://github.com/conventional-changelog/standard-version) for commit guidelines.
4
4
 
5
+ <a name="9.10.0"></a>
6
+ # [9.10.0](https://github.com/gemini-testing/html-reporter/compare/v9.9.2...v9.10.0) (2023-07-03)
7
+
8
+
9
+ ### Features
10
+
11
+ * retry tests with checkboxes ([d3190c1](https://github.com/gemini-testing/html-reporter/commit/d3190c1))
12
+
13
+
14
+
5
15
  <a name="9.9.2"></a>
6
16
  ## [9.9.2](https://github.com/gemini-testing/html-reporter/compare/v9.9.1...v9.9.2) (2023-06-28)
7
17
 
@@ -15,6 +15,7 @@ const {
15
15
  RUNNING,
16
16
  QUEUED
17
17
  } = require('./constants/test-statuses');
18
+ const {UNCHECKED, INDETERMINATE, CHECKED} = require('./constants/checked-statuses');
18
19
 
19
20
  exports.getShortMD5 = (str) => {
20
21
  return crypto.createHash('md5').update(str, 'ascii').digest('hex').substr(0, 7);
@@ -115,3 +116,8 @@ function isRelativeUrl(url) {
115
116
  return true;
116
117
  }
117
118
  }
119
+
120
+ exports.isCheckboxChecked = (status) => status == CHECKED; // eslint-disable-line eqeqeq
121
+ exports.isCheckboxIndeterminate = (status) => status == INDETERMINATE; // eslint-disable-line eqeqeq
122
+ exports.isCheckboxUnchecked = (status) => status == UNCHECKED; // eslint-disable-line eqeqeq
123
+ exports.getToggledCheckboxState = (status) => exports.isCheckboxChecked(status) ? UNCHECKED : CHECKED;
@@ -0,0 +1,7 @@
1
+ 'use strict';
2
+
3
+ module.exports = {
4
+ UNCHECKED: 0,
5
+ INDETERMINATE: 0.5,
6
+ CHECKED: 1
7
+ };
@@ -0,0 +1,30 @@
1
+ import React from 'react';
2
+ import classNames from 'classnames';
3
+ import {Checkbox} from 'semantic-ui-react';
4
+ import PropTypes from 'prop-types';
5
+ import {isCheckboxChecked, isCheckboxIndeterminate} from '../../common-utils';
6
+ import {CHECKED, INDETERMINATE, UNCHECKED} from '../../constants/checked-statuses';
7
+ import useLocalStorage from '../hooks/useLocalStorage';
8
+
9
+ const Bullet = ({status, onClick, className}) => {
10
+ const [isCheckbox] = useLocalStorage('showCheckboxes', false);
11
+
12
+ if (!isCheckbox) {
13
+ return <span className={classNames('bullet_type-simple', className)} />;
14
+ }
15
+
16
+ return <Checkbox
17
+ className={classNames('bullet_type-checkbox', className)}
18
+ checked={isCheckboxChecked(status)}
19
+ indeterminate={isCheckboxIndeterminate(status)}
20
+ onClick={onClick}
21
+ />;
22
+ };
23
+
24
+ Bullet.propTypes = {
25
+ status: PropTypes.oneOf([CHECKED, UNCHECKED, INDETERMINATE]),
26
+ onClick: PropTypes.func,
27
+ bulletClassName: PropTypes.string
28
+ };
29
+
30
+ export default Bullet;
@@ -6,11 +6,12 @@ import {connect} from 'react-redux';
6
6
  import * as actions from '../../modules/actions';
7
7
  import TestNameFilterInput from './test-name-filter-input';
8
8
  import StrictMatchFilterInput from './strict-match-filter-input';
9
+ import ShowCheckboxesInput from './show-checkboxes-input';
9
10
  import BrowserList from './browser-list';
10
11
 
11
12
  class CommonFilters extends Component {
12
13
  render() {
13
- const {filteredBrowsers, browsers, actions} = this.props;
14
+ const {filteredBrowsers, browsers, gui, actions} = this.props;
14
15
 
15
16
  return (
16
17
  <div className="control-container control-filters">
@@ -21,12 +22,13 @@ class CommonFilters extends Component {
21
22
  />
22
23
  <TestNameFilterInput/>
23
24
  <StrictMatchFilterInput/>
25
+ {gui && <ShowCheckboxesInput/>}
24
26
  </div>
25
27
  );
26
28
  }
27
29
  }
28
30
 
29
31
  export default connect(
30
- ({view, browsers}) => ({filteredBrowsers: view.filteredBrowsers, browsers}),
32
+ ({view, browsers, gui}) => ({filteredBrowsers: view.filteredBrowsers, browsers, gui}),
31
33
  (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
32
34
  )(CommonFilters);
@@ -9,7 +9,6 @@ import ControlButton from './control-button';
9
9
  import RunButton from './run-button';
10
10
  import AcceptOpenedButton from './accept-opened-button';
11
11
  import CommonFilters from './common-filters';
12
- import {getFailedTests} from '../../modules/selectors/tree';
13
12
 
14
13
  import './controls.less';
15
14
 
@@ -17,40 +16,16 @@ class GuiControls extends Component {
17
16
  static propTypes = {
18
17
  // from store
19
18
  running: PropTypes.bool.isRequired,
20
- processing: PropTypes.bool.isRequired,
21
- stopping: PropTypes.bool.isRequired,
22
- autoRun: PropTypes.bool.isRequired,
23
- allRootSuiteIds: PropTypes.arrayOf(PropTypes.string).isRequired,
24
- failedRootSuiteIds: PropTypes.arrayOf(PropTypes.string).isRequired,
25
- failedTests: PropTypes.arrayOf(PropTypes.shape({
26
- testName: PropTypes.string,
27
- browserName: PropTypes.string
28
- })).isRequired
29
- }
30
-
31
- _runFailedTests = () => {
32
- const {actions, failedTests} = this.props;
33
-
34
- return actions.runFailedTests(failedTests);
19
+ stopping: PropTypes.bool.isRequired
35
20
  }
36
21
 
37
22
  render() {
38
- const {actions, allRootSuiteIds, failedRootSuiteIds, running, autoRun, processing, stopping} = this.props;
23
+ const {actions, running, stopping} = this.props;
39
24
  return (
40
25
  <div className="main-menu container">
41
26
  <CustomGuiControls />
42
27
  <div className="control-container control-buttons">
43
- <RunButton
44
- autoRun={autoRun}
45
- isDisabled={!allRootSuiteIds.length || processing}
46
- handler={actions.runAllTests}
47
- isRunning={running}
48
- />
49
- <ControlButton
50
- label="Retry failed tests"
51
- isDisabled={!failedRootSuiteIds.length || processing}
52
- handler={this._runFailedTests}
53
- />
28
+ <RunButton />
54
29
  <ControlButton
55
30
  label="Stop tests"
56
31
  isDisabled={!running || stopping}
@@ -66,16 +41,6 @@ class GuiControls extends Component {
66
41
  }
67
42
 
68
43
  export default connect(
69
- (state) => {
70
- return {
71
- running: state.running,
72
- processing: state.processing,
73
- stopping: state.stopping,
74
- autoRun: state.autoRun,
75
- allRootSuiteIds: state.tree.suites.allRootIds,
76
- failedRootSuiteIds: state.tree.suites.failedRootIds,
77
- failedTests: getFailedTests(state)
78
- };
79
- },
44
+ ({running, stopping}) => ({running, stopping}),
80
45
  (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
81
46
  )(GuiControls);
@@ -0,0 +1,129 @@
1
+ 'use strict';
2
+
3
+ import React, {useEffect, useState} from 'react';
4
+ import {bindActionCreators} from 'redux';
5
+ import {isEmpty} from 'lodash';
6
+ import {connect} from 'react-redux';
7
+ import PropTypes from 'prop-types';
8
+ import classNames from 'classnames';
9
+ import * as actions from '../../../modules/actions';
10
+ import Popup from '../../popup';
11
+ import {getFailedTests, getCheckedTests} from '../../../modules/selectors/tree';
12
+ import useLocalStorage from '../../../hooks/useLocalStorage';
13
+
14
+ import './index.styl';
15
+
16
+ const RunMode = Object.freeze({
17
+ ALL: 'All',
18
+ FAILED: 'Failed',
19
+ CHECKED: 'Checked'
20
+ });
21
+
22
+ const RunButton = ({actions, autoRun, isDisabled, isRunning, failedTests, checkedTests}) => {
23
+ const [mode, setMode] = useState(RunMode.ALL);
24
+ const [showCheckboxes] = useLocalStorage('showCheckboxes', false);
25
+
26
+ const btnClassName = classNames('btn', {'button_blink': isRunning});
27
+
28
+ const shouldDisableFailed = isEmpty(failedTests);
29
+ const shouldDisableChecked = !showCheckboxes || isEmpty(checkedTests);
30
+
31
+ const selectAllTests = () => setMode(RunMode.ALL);
32
+ const selectFailedTests = () => !shouldDisableFailed && setMode(RunMode.FAILED);
33
+ const selectCheckedTests = () => !shouldDisableChecked && setMode(RunMode.CHECKED);
34
+
35
+ const runAllTests = () => actions.runAllTests();
36
+ const runFailedTests = () => actions.runFailedTests(failedTests);
37
+ const runCheckedTests = () => actions.retrySuite(checkedTests);
38
+
39
+ const handleRunClick = () => {
40
+ const action = {
41
+ [RunMode.ALL]: runAllTests,
42
+ [RunMode.FAILED]: runFailedTests,
43
+ [RunMode.CHECKED]: runCheckedTests
44
+ }[mode];
45
+
46
+ action();
47
+ };
48
+
49
+ useEffect(() => {
50
+ if (autoRun) {
51
+ runAllTests();
52
+ }
53
+ }, []);
54
+
55
+ useEffect(() => {
56
+ selectCheckedTests();
57
+ }, [shouldDisableChecked]);
58
+
59
+ useEffect(() => {
60
+ const shouldResetFailedMode = mode === RunMode.FAILED && shouldDisableFailed;
61
+ const shouldResetCheckedMode = mode === RunMode.CHECKED && shouldDisableChecked;
62
+
63
+ if (shouldResetFailedMode || shouldResetCheckedMode) {
64
+ setMode(RunMode.ALL);
65
+ }
66
+ }, [shouldDisableFailed, shouldDisableChecked]);
67
+
68
+ return (
69
+ <div className='run-button'>
70
+ <button disabled={isDisabled} onClick={handleRunClick} className={btnClassName}>
71
+ {isRunning ? 'Running' : `Run ${mode.toLowerCase()} tests`}
72
+ </button>
73
+ {!isDisabled && <Popup
74
+ action='hover'
75
+ hideOnClick={true}
76
+ target={<div className='run-button__dropdown' />}
77
+ >
78
+ <ul className='run-mode'>
79
+ <li
80
+ className='run-mode__item'
81
+ onClick={selectAllTests}
82
+ >
83
+ {RunMode.ALL}
84
+ </li>
85
+ <li
86
+ className={classNames('run-mode__item', {'run-mode__item_disabled': shouldDisableFailed})}
87
+ onClick={selectFailedTests}>{RunMode.FAILED}
88
+ </li>
89
+ <li
90
+ className={classNames('run-mode__item', {'run-mode__item_disabled': shouldDisableChecked})}
91
+ onClick={selectCheckedTests}
92
+ >
93
+ {RunMode.CHECKED}
94
+ </li>
95
+ </ul>
96
+ </Popup>}
97
+ </div>
98
+ );
99
+ };
100
+
101
+ RunButton.propTypes = {
102
+ // from store
103
+ autoRun: PropTypes.bool.isRequired,
104
+ isDisabled: PropTypes.bool,
105
+ isRunning: PropTypes.bool,
106
+ failedTests: PropTypes.arrayOf(PropTypes.shape({
107
+ testName: PropTypes.string,
108
+ browserName: PropTypes.string
109
+ })).isRequired,
110
+ checkedTests: PropTypes.arrayOf(PropTypes.shape({
111
+ testName: PropTypes.string,
112
+ browserName: PropTypes.string
113
+ })).isRequired
114
+ };
115
+
116
+ export default connect(
117
+ (state) => {
118
+ const autoRun = state.autoRun;
119
+ const allRootSuiteIds = state.tree.suites.allRootIds;
120
+ const processing = state.processing;
121
+ const isDisabled = !allRootSuiteIds.length || processing;
122
+ const isRunning = state.running;
123
+ const failedTests = getFailedTests(state);
124
+ const checkedTests = getCheckedTests(state);
125
+
126
+ return {autoRun, isDisabled, isRunning, failedTests, checkedTests};
127
+ },
128
+ (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
129
+ )(RunButton);
@@ -0,0 +1,49 @@
1
+ .run-button {
2
+ display: inline-flex;
3
+ align-items: center;
4
+ cursor: pointer;
5
+ width: 143px;
6
+ font-size: 11px;
7
+ line-height: 11px;
8
+ border: 1px solid #ccc;
9
+ border-radius: 2px;
10
+ background-color: #ffeba0;
11
+
12
+ .btn {
13
+ flex-grow: 1;
14
+ height: 100%;
15
+ background-color: #ffeba0;
16
+ cursor: pointer;
17
+ border: none;
18
+ }
19
+
20
+ .run-button__dropdown {
21
+ font-family: Dropdown;
22
+
23
+ &::before {
24
+ content: '\f0d7';
25
+ padding: 5px;
26
+ border-left: 1px solid #ccc;
27
+ }
28
+ }
29
+
30
+ .popup__content {
31
+ padding: 0;
32
+ }
33
+
34
+ .run-mode {
35
+ padding: 0;
36
+
37
+ .run-mode__item {
38
+ font-size: 13px;
39
+ padding: 5px 10px;
40
+ list-style: none;
41
+ user-select: none;
42
+
43
+ &.run-mode__item_disabled {
44
+ color: #939393;
45
+ cursor: auto;
46
+ }
47
+ }
48
+ }
49
+ }
@@ -0,0 +1,24 @@
1
+ 'use strict';
2
+
3
+ import React from 'react';
4
+ import {Checkbox} from 'semantic-ui-react';
5
+ import useLocalStorage from '../../hooks/useLocalStorage';
6
+
7
+ const ShowCheckboxesInput = () => {
8
+ const [showCheckboxes, setShowCheckboxes] = useLocalStorage('showCheckboxes', false);
9
+
10
+ const onChange = () => setShowCheckboxes(!showCheckboxes);
11
+
12
+ return (
13
+ <div className="toggle-control">
14
+ <Checkbox
15
+ toggle
16
+ label="Checkboxes"
17
+ onChange={onChange}
18
+ checked={showCheckboxes}
19
+ />
20
+ </div>
21
+ );
22
+ };
23
+
24
+ export default ShowCheckboxesInput;
@@ -17,7 +17,7 @@ const StrictMatchFilterInput = ({strictMatchFilter, actions}) => {
17
17
  };
18
18
 
19
19
  return (
20
- <div className="strict-match-filter">
20
+ <div className="toggle-control">
21
21
  <Checkbox
22
22
  toggle
23
23
  label="Strict match"
@@ -1,39 +1,66 @@
1
- import React, {Component} from 'react';
1
+ import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
+ import {connect} from 'react-redux';
4
+ import {bindActionCreators} from 'redux';
3
5
  import classNames from 'classnames';
4
6
 
7
+ import * as actions from '../../modules/actions';
5
8
  import Suites from '../suites';
9
+ import {INDETERMINATE} from '../../../constants/checked-statuses';
10
+ import {getToggledCheckboxState} from '../../../common-utils';
11
+ import Bullet from '../bullet';
6
12
 
7
- export default class GroupTestsItem extends Component {
8
- static propTypes = {
9
- group: PropTypes.object.isRequired,
10
- isActive: PropTypes.bool.isRequired,
11
- onClick: PropTypes.func.isRequired
12
- }
13
+ const GroupTestsItem = ({group, isActive, onClick, checkStatus, actions}) => {
14
+ const {name, pattern, testCount, resultCount} = group;
13
15
 
14
- render() {
15
- const {group, isActive, onClick} = this.props;
16
- const {name, pattern, testCount, resultCount} = group;
16
+ const body = isActive ? (
17
+ <div className="tests-group__body">
18
+ <Suites />
19
+ </div>
20
+ ) : null;
17
21
 
18
- const body = isActive ? (
19
- <div className="tests-group__body">
20
- <Suites />
21
- </div>
22
- ) : null;
23
-
24
- const className = classNames(
25
- 'tests-group',
26
- {'tests-group_collapsed': !isActive}
27
- );
28
-
29
- return (
30
- <div className={className}>
31
- <div className="tests-group__title" onClick={onClick} title={pattern}>
32
- <span className="tests-group__name">{name}</span>
33
- <span className="tests-group__count">&nbsp;({`tests: ${testCount}, runs: ${resultCount}`})</span>
34
- </div>
35
- {body}
22
+ const className = classNames(
23
+ 'tests-group',
24
+ {'tests-group_collapsed': !isActive}
25
+ );
26
+
27
+ const onToggleCheckbox = (e) => {
28
+ e.stopPropagation();
29
+
30
+ actions.toggleGroupCheckbox({
31
+ browserIds: group.browserIds,
32
+ checkStatus: getToggledCheckboxState(checkStatus)
33
+ });
34
+ };
35
+
36
+ return (
37
+ <div className={className}>
38
+ <div className="tests-group__title" onClick={onClick} title={pattern}>
39
+ <Bullet status={checkStatus} onClick={onToggleCheckbox} className='tests-group__bullet'/>
40
+ <span className="tests-group__name">{name}</span>
41
+ <span className="tests-group__count">&nbsp;({`tests: ${testCount}, runs: ${resultCount}`})</span>
36
42
  </div>
37
- );
38
- }
39
- }
43
+ {body}
44
+ </div>
45
+ );
46
+ };
47
+
48
+ GroupTestsItem.propTypes = {
49
+ group: PropTypes.object.isRequired,
50
+ isActive: PropTypes.bool.isRequired,
51
+ onClick: PropTypes.func.isRequired,
52
+ checkStatus: PropTypes.number
53
+ };
54
+
55
+ export default connect(
56
+ ({tree}, {group}) => {
57
+ const childCount = group.browserIds.length;
58
+ const checkedCount = group.browserIds.reduce((sum, browserId) => {
59
+ return sum + tree.browsers.stateById[browserId].checkStatus;
60
+ }, 0);
61
+ const checkStatus = Number((checkedCount === childCount) || (checkedCount && INDETERMINATE));
62
+
63
+ return {checkStatus};
64
+ },
65
+ (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
66
+ )(GroupTestsItem);
@@ -9,7 +9,7 @@ import './index.styl';
9
9
  const OVERFLOW_BORDER = 20;
10
10
 
11
11
  const Popup = (props) => {
12
- const {action, target, children, ...rest} = props;
12
+ const {action, target, hideOnClick, children, ...rest} = props;
13
13
 
14
14
  const isClickHandled = useRef(false);
15
15
  const [show, setShow] = useState(false);
@@ -41,6 +41,8 @@ const Popup = (props) => {
41
41
  const mouseClickOuterHandler = action === 'click' ? () => handleClick(true) : null;
42
42
  const mouseClickAwayHandler = action === 'click' ? () => handleClick(false, {isLast: true}) : null;
43
43
 
44
+ const childrenClickHandler = hideOnClick ? () => setShow(false) : null;
45
+
44
46
  useEffect(() => {
45
47
  if (mouseClickAwayHandler) {
46
48
  window.addEventListener('click', mouseClickAwayHandler);
@@ -69,6 +71,7 @@ const Popup = (props) => {
69
71
  ref={popupRef}
70
72
  className='popup__content'
71
73
  style={{transform: `translate(${-overflow}px)`}}
74
+ onClick={childrenClickHandler}
72
75
  >
73
76
  {children}
74
77
  </div>
@@ -79,7 +82,8 @@ const Popup = (props) => {
79
82
 
80
83
  Popup.propTypes = {
81
84
  action: PropTypes.oneOf(['hover', 'click']).isRequired,
82
- target: PropTypes.node.isRequired
85
+ target: PropTypes.node.isRequired,
86
+ hideOnClick: PropTypes.bool
83
87
  };
84
88
 
85
89
  export default Popup;
@@ -1,37 +1,43 @@
1
- .popup
2
- position absolute
3
- z-index 1500
4
- transform translate(-50%, -1px)
1
+ .popup {
2
+ position: absolute;
3
+ z-index: 1500;
4
+ transform: translate(-50%, -1px);
5
5
 
6
- &.popup_visible
7
- visibility visible
6
+ &.popup_visible {
7
+ visibility: visible;
8
+ }
8
9
 
9
- &.popup_hidden
10
- visibility hidden
10
+ &.popup_hidden {
11
+ visibility: hidden;
12
+ }
11
13
 
12
- .popup__pointer
13
- position relative
14
- height pointer-height = 20px
14
+ .popup__pointer {
15
+ position: relative;
16
+ height: pointer-height = 20px;
15
17
 
16
- &::after
17
- content ''
18
- pointer-border-width = 1px
19
- border-left pointer-border-width solid #ccc
20
- border-top pointer-border-width solid #ccc
21
- margin-top pointer-height - (2 * pointer-border-width * math(2, 'sqrt'))
22
- position absolute
23
- box-sizing content-box
24
- height 20px
25
- width 20px
26
- background white
27
- z-index 1400
28
- left 50%
29
- transform rotate(45deg) translate(-50%)
30
-
31
- .popup__content
32
- border 1px solid #ccc
33
- border-radius .25rem
34
- box-shadow 0 2px 4px 0 rgba(34, 36, 38, .12),
35
- 0 2px 10px 0 rgba(34, 36, 38, .15)
36
- background-color white
37
- padding 15px
18
+ &::after {
19
+ content: '';
20
+ pointer-border-width = 1px;
21
+ border-left: pointer-border-width solid #ccc;
22
+ border-top: pointer-border-width solid #ccc;
23
+ margin-top: pointer-height - (2 * pointer-border-width * math(2, 'sqrt'));
24
+ position: absolute;
25
+ box-sizing: content-box;
26
+ height: 20px;
27
+ width: 20px;
28
+ background: white;
29
+ z-index: 1400;
30
+ left: 50%;
31
+ transform: rotate(45deg) translate(-50%);
32
+ }
33
+ }
34
+
35
+ .popup__content {
36
+ border: 1px solid #ccc;
37
+ border-radius: .25rem;
38
+ box-shadow: 0 2px 4px 0 rgba(34, 36, 38, .12),
39
+ 0 2px 10px 0 rgba(34, 36, 38, .15);
40
+ background-color: white;
41
+ padding: 15px;
42
+ }
43
+ }
@@ -79,7 +79,7 @@ class SectionBrowser extends Component {
79
79
  );
80
80
 
81
81
  const section = isSkipped
82
- ? <BrowserSkippedTitle title={title} />
82
+ ? <BrowserSkippedTitle title={title} browserId={browser.id} />
83
83
  : (
84
84
  <Fragment>
85
85
  <BrowserTitle
@@ -1,22 +1,39 @@
1
1
  'use strict';
2
2
 
3
- import React, {Component} from 'react';
3
+ import React from 'react';
4
4
  import PropTypes from 'prop-types';
5
+ import {connect} from 'react-redux';
6
+ import {bindActionCreators} from 'redux';
7
+ import * as actions from '../../../modules/actions';
8
+ import {getToggledCheckboxState} from '../../../../common-utils';
9
+ import Bullet from '../../bullet';
5
10
 
6
- class BrowserSkippedTitle extends Component {
7
- static propTypes = {
8
- title: PropTypes.object.isRequired
9
- }
11
+ const BrowserSkippedTitle = (props) => {
12
+ const onToggleCheckbox = (e) => {
13
+ e.stopPropagation();
10
14
 
11
- render() {
12
- const {title} = this.props;
15
+ props.actions.toggleBrowserCheckbox({
16
+ suiteBrowserId: props.browserId,
17
+ checkStatus: getToggledCheckboxState(props.checkStatus)
18
+ });
19
+ };
13
20
 
14
- return (
15
- <div className="section__title section__title_skipped">
16
- {title}
17
- </div>
18
- );
19
- }
20
- }
21
+ return (
22
+ <div className="section__title section__title_skipped">
23
+ <Bullet status={props.checkStatus} onClick={onToggleCheckbox} />
24
+ {props.title}
25
+ </div>
26
+ );
27
+ };
21
28
 
22
- export default BrowserSkippedTitle;
29
+ BrowserSkippedTitle.propTypes = {
30
+ title: PropTypes.object.isRequired,
31
+ browserId: PropTypes.string.isRequired,
32
+ // from store
33
+ checkStatus: PropTypes.number.isRequired
34
+ };
35
+
36
+ export default connect(
37
+ ({tree}, {browserId}) => ({checkStatus: tree.browsers.stateById[browserId].checkStatus}),
38
+ (dispatch) => ({actions: bindActionCreators(actions, dispatch)})
39
+ )(BrowserSkippedTitle);