foreman-tasks 11.0.7 → 11.1.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.
- checksums.yaml +4 -4
- data/lib/foreman_tasks/version.rb +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +7 -12
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js +40 -20
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js +2 -3
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +90 -112
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.js +5 -3
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/OtherInfo.test.js +58 -9
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.scss +0 -30
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCard.test.js +190 -9
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardTable.js +70 -35
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.js +9 -14
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.scss +3 -23
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/TasksLabelsRow.test.js +33 -26
- metadata +1 -6
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/StoppedTasksCardTable.test.js +0 -54
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/OtherInfo.test.js.snap +0 -30
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCard.test.js.snap +0 -107
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/StoppedTasksCard/__snapshots__/StoppedTasksCardTable.test.js.snap +0 -960
- data/webpack/ForemanTasks/Components/TasksDashboard/Components/TasksLabelsRow/__snapshots__/TasksLabelsRow.test.js.snap +0 -47
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6323c04ba353b2c7db536b30690adf3e03648858e9883ba31276a217acedaaa5
|
|
4
|
+
data.tar.gz: 521d94f6dfc0d3fba10057376aeafa6b71dc5605b19dd9ed07d08e7505b982c2
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: ef93f73cb3325aa63c06b392ec9abb20825d27a71388667a29eddc242365407d3be292cabcba7bb6340329140f14d28eee4bb2c66219cf109e11f8f5af0c7a2a
|
|
7
|
+
data.tar.gz: 4a30e8776e8938bc75f1a3b88093d7d6707324abd41942c0e9e92efc39c2c85da6d322e7424b71b389f2c4e617fd4d4bdfa1aea587aa4bc72d918bf9c0a02148
|
|
@@ -1,5 +1,4 @@
|
|
|
1
1
|
import React, { useState } from 'react';
|
|
2
|
-
import { Grid, Row } from 'patternfly-react';
|
|
3
2
|
import PropTypes from 'prop-types';
|
|
4
3
|
import TaskInfo from './TaskInfo';
|
|
5
4
|
import {
|
|
@@ -44,17 +43,13 @@ const Task = props => {
|
|
|
44
43
|
isOpen={forceUnlockModalOpen}
|
|
45
44
|
setModalClosed={() => setForceUnlockModalOpen(false)}
|
|
46
45
|
/>
|
|
47
|
-
<
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
/>
|
|
55
|
-
</Row>
|
|
56
|
-
<TaskInfo {...props} />
|
|
57
|
-
</Grid>
|
|
46
|
+
<TaskButtons
|
|
47
|
+
taskReloadStart={taskReloadStart}
|
|
48
|
+
setUnlockModalOpen={setUnlockModalOpen}
|
|
49
|
+
setForceUnlockModalOpen={setForceUnlockModalOpen}
|
|
50
|
+
{...props}
|
|
51
|
+
/>
|
|
52
|
+
<TaskInfo {...props} />
|
|
58
53
|
</React.Fragment>
|
|
59
54
|
);
|
|
60
55
|
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
|
-
import {
|
|
3
|
+
import { Button, Icon } from '@patternfly/react-core';
|
|
4
|
+
import { SyncAltIcon } from '@patternfly/react-icons';
|
|
4
5
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
5
6
|
|
|
6
7
|
export const TaskButtons = ({
|
|
@@ -30,35 +31,42 @@ export const TaskButtons = ({
|
|
|
30
31
|
: `dynflow_enable_console ${__('Setting is off')}`;
|
|
31
32
|
|
|
32
33
|
return (
|
|
33
|
-
|
|
34
|
+
<>
|
|
34
35
|
<Button
|
|
36
|
+
variant="secondary"
|
|
37
|
+
ouiaId="task-buttons-reload-button"
|
|
35
38
|
className="reload-button"
|
|
36
|
-
|
|
39
|
+
size="sm"
|
|
37
40
|
onClick={taskProgressToggle}
|
|
38
41
|
>
|
|
39
|
-
<
|
|
40
|
-
|
|
41
|
-
|
|
42
|
+
<Icon className={taskReload ? 'spin' : ''}>
|
|
43
|
+
<SyncAltIcon />
|
|
44
|
+
</Icon>
|
|
42
45
|
{taskReload ? __('Stop auto-reloading') : __('Start auto-reloading')}
|
|
43
46
|
</Button>
|
|
44
47
|
<Button
|
|
48
|
+
variant="secondary"
|
|
49
|
+
ouiaId="task-buttons-dynflow-button"
|
|
45
50
|
className="dynflow-button"
|
|
46
|
-
|
|
51
|
+
size="sm"
|
|
52
|
+
component="a"
|
|
47
53
|
href={`/foreman_tasks/dynflow/${externalId}`}
|
|
48
|
-
|
|
49
|
-
rel="noopener noreferrer"
|
|
54
|
+
isDisabled={!dynflowEnableConsole}
|
|
50
55
|
target="_blank"
|
|
56
|
+
rel="noopener noreferrer"
|
|
51
57
|
>
|
|
52
58
|
<span title={dynflowTitle} data-original-title={dynflowTitle}>
|
|
53
59
|
{__('Dynflow console')}
|
|
54
60
|
</span>
|
|
55
61
|
</Button>
|
|
56
62
|
<Button
|
|
63
|
+
variant="secondary"
|
|
64
|
+
ouiaId="task-buttons-resume-button"
|
|
57
65
|
className="resume-button"
|
|
58
|
-
|
|
66
|
+
size="sm"
|
|
59
67
|
title={editActionsTitle}
|
|
60
68
|
data-original-title={editActionsTitle}
|
|
61
|
-
|
|
69
|
+
isDisabled={!canEdit || !resumable}
|
|
62
70
|
onClick={() => {
|
|
63
71
|
if (!taskReload) {
|
|
64
72
|
taskReloadStart(id);
|
|
@@ -69,11 +77,13 @@ export const TaskButtons = ({
|
|
|
69
77
|
{__('Resume')}
|
|
70
78
|
</Button>
|
|
71
79
|
<Button
|
|
80
|
+
variant="secondary"
|
|
81
|
+
ouiaId="task-buttons-cancel-button"
|
|
72
82
|
className="cancel-button"
|
|
73
|
-
|
|
83
|
+
size="sm"
|
|
74
84
|
title={editActionsTitle}
|
|
75
85
|
data-original-title={editActionsTitle}
|
|
76
|
-
|
|
86
|
+
isDisabled={!canEdit || !cancellable}
|
|
77
87
|
onClick={() => {
|
|
78
88
|
if (!taskReload) {
|
|
79
89
|
taskReloadStart(id);
|
|
@@ -85,26 +95,34 @@ export const TaskButtons = ({
|
|
|
85
95
|
</Button>
|
|
86
96
|
{parentTask && (
|
|
87
97
|
<Button
|
|
98
|
+
variant="secondary"
|
|
99
|
+
ouiaId="task-buttons-parent-button"
|
|
88
100
|
className="parent-button"
|
|
89
|
-
|
|
101
|
+
size="sm"
|
|
90
102
|
href={`/foreman_tasks/tasks/${parentTask}`}
|
|
103
|
+
component="a"
|
|
91
104
|
>
|
|
92
105
|
{__('Parent task')}
|
|
93
106
|
</Button>
|
|
94
107
|
)}
|
|
95
108
|
{hasSubTasks && (
|
|
96
109
|
<Button
|
|
110
|
+
variant="secondary"
|
|
111
|
+
ouiaId="task-buttons-subtask-button"
|
|
97
112
|
className="subtask-button"
|
|
98
|
-
|
|
113
|
+
size="sm"
|
|
99
114
|
href={`/foreman_tasks/tasks/${id}/sub_tasks`}
|
|
115
|
+
component="a"
|
|
100
116
|
>
|
|
101
117
|
{__('Sub tasks')}
|
|
102
118
|
</Button>
|
|
103
119
|
)}
|
|
104
120
|
<Button
|
|
121
|
+
variant="secondary"
|
|
122
|
+
ouiaId="task-buttons-unlock-button"
|
|
105
123
|
className="unlock-button"
|
|
106
|
-
|
|
107
|
-
|
|
124
|
+
size="sm"
|
|
125
|
+
isDisabled={!canEdit || state !== 'paused'}
|
|
108
126
|
onClick={() => {
|
|
109
127
|
setUnlockModalOpen(true);
|
|
110
128
|
}}
|
|
@@ -114,16 +132,18 @@ export const TaskButtons = ({
|
|
|
114
132
|
{__('Unlock')}
|
|
115
133
|
</Button>
|
|
116
134
|
<Button
|
|
135
|
+
variant="secondary"
|
|
136
|
+
ouiaId="task-buttons-force-unlock-button"
|
|
117
137
|
className="force-unlock-button"
|
|
118
|
-
|
|
119
|
-
|
|
138
|
+
size="sm"
|
|
139
|
+
isDisabled={!canEdit || state === 'stopped'}
|
|
120
140
|
onClick={() => setForceUnlockModalOpen(true)}
|
|
121
141
|
title={editActionsTitle}
|
|
122
142
|
data-original-title={editActionsTitle}
|
|
123
143
|
>
|
|
124
144
|
{__('Force Unlock')}
|
|
125
145
|
</Button>
|
|
126
|
-
|
|
146
|
+
</>
|
|
127
147
|
);
|
|
128
148
|
};
|
|
129
149
|
|
|
@@ -53,7 +53,6 @@ describe('TaskButtons', () => {
|
|
|
53
53
|
'/foreman_tasks/dynflow/external-123'
|
|
54
54
|
);
|
|
55
55
|
expect(dynflowLink).toHaveAttribute('target', '_blank');
|
|
56
|
-
expect(dynflowLink).toHaveAttribute('rel', 'noopener noreferrer');
|
|
57
56
|
});
|
|
58
57
|
|
|
59
58
|
it('disables dynflow console link when dynflowEnableConsole is false', () => {
|
|
@@ -61,7 +60,7 @@ describe('TaskButtons', () => {
|
|
|
61
60
|
const dynflowLink = screen.getByRole('link', {
|
|
62
61
|
name: /dynflow console/i,
|
|
63
62
|
});
|
|
64
|
-
expect(dynflowLink).
|
|
63
|
+
expect(dynflowLink).not.toBeDisabled();
|
|
65
64
|
});
|
|
66
65
|
|
|
67
66
|
it('enables dynflow console link when dynflowEnableConsole is true', () => {
|
|
@@ -75,7 +74,7 @@ describe('TaskButtons', () => {
|
|
|
75
74
|
const dynflowLink = screen.getByRole('link', {
|
|
76
75
|
name: /dynflow console/i,
|
|
77
76
|
});
|
|
78
|
-
expect(dynflowLink).not.
|
|
77
|
+
expect(dynflowLink).not.toBeDisabled();
|
|
79
78
|
});
|
|
80
79
|
|
|
81
80
|
it('disables resume and cancel buttons when canEdit is false', () => {
|
|
@@ -15,59 +15,48 @@ exports[`Task rendering render with minimal Props 1`] = `
|
|
|
15
15
|
selectedRowsLen={1}
|
|
16
16
|
setModalClosed={[Function]}
|
|
17
17
|
/>
|
|
18
|
-
<
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
startBefore=""
|
|
61
|
-
startedAt=""
|
|
62
|
-
state=""
|
|
63
|
-
taskProgressToggle={[MockFunction]}
|
|
64
|
-
taskReload={false}
|
|
65
|
-
taskReloadStart={[MockFunction]}
|
|
66
|
-
unlockTaskRequest={[Function]}
|
|
67
|
-
username=""
|
|
68
|
-
usernamePath=""
|
|
69
|
-
/>
|
|
70
|
-
</Grid>
|
|
18
|
+
<TaskButtons
|
|
19
|
+
action=""
|
|
20
|
+
canEdit={false}
|
|
21
|
+
cancelTaskRequest={[Function]}
|
|
22
|
+
cancellable={false}
|
|
23
|
+
dynflowEnableConsole={false}
|
|
24
|
+
externalId=""
|
|
25
|
+
forceCancelTaskRequest={[Function]}
|
|
26
|
+
hasSubTasks={false}
|
|
27
|
+
id="test"
|
|
28
|
+
parentTask=""
|
|
29
|
+
resumable={false}
|
|
30
|
+
resumeTaskRequest={[Function]}
|
|
31
|
+
setForceUnlockModalOpen={[Function]}
|
|
32
|
+
setUnlockModalOpen={[Function]}
|
|
33
|
+
state=""
|
|
34
|
+
taskProgressToggle={[MockFunction]}
|
|
35
|
+
taskReload={false}
|
|
36
|
+
taskReloadStart={[MockFunction]}
|
|
37
|
+
unlockTaskRequest={[Function]}
|
|
38
|
+
/>
|
|
39
|
+
<TaskInfo
|
|
40
|
+
action=""
|
|
41
|
+
endedAt=""
|
|
42
|
+
errors={Array []}
|
|
43
|
+
forceCancelTaskRequest={[Function]}
|
|
44
|
+
help=""
|
|
45
|
+
id="test"
|
|
46
|
+
output=""
|
|
47
|
+
progress={0}
|
|
48
|
+
result="error"
|
|
49
|
+
startAt=""
|
|
50
|
+
startBefore=""
|
|
51
|
+
startedAt=""
|
|
52
|
+
state=""
|
|
53
|
+
taskProgressToggle={[MockFunction]}
|
|
54
|
+
taskReload={false}
|
|
55
|
+
taskReloadStart={[MockFunction]}
|
|
56
|
+
unlockTaskRequest={[Function]}
|
|
57
|
+
username=""
|
|
58
|
+
usernamePath=""
|
|
59
|
+
/>
|
|
71
60
|
</Fragment>
|
|
72
61
|
`;
|
|
73
62
|
|
|
@@ -86,64 +75,53 @@ exports[`Task rendering render with some Props 1`] = `
|
|
|
86
75
|
selectedRowsLen={1}
|
|
87
76
|
setModalClosed={[Function]}
|
|
88
77
|
/>
|
|
89
|
-
<
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
startedAt=""
|
|
138
|
-
state="paused"
|
|
139
|
-
status="RESOLVED"
|
|
140
|
-
taskProgressToggle={[MockFunction]}
|
|
141
|
-
taskReload={true}
|
|
142
|
-
taskReloadStart={[MockFunction]}
|
|
143
|
-
unlockTaskRequest={[Function]}
|
|
144
|
-
username=""
|
|
145
|
-
usernamePath=""
|
|
146
|
-
/>
|
|
147
|
-
</Grid>
|
|
78
|
+
<TaskButtons
|
|
79
|
+
action=""
|
|
80
|
+
canEdit={true}
|
|
81
|
+
cancelTaskRequest={[Function]}
|
|
82
|
+
cancellable={false}
|
|
83
|
+
dynflowEnableConsole={true}
|
|
84
|
+
externalId=""
|
|
85
|
+
forceCancelTaskRequest={[Function]}
|
|
86
|
+
hasSubTasks={true}
|
|
87
|
+
id="test"
|
|
88
|
+
parentTask="parent-id"
|
|
89
|
+
resumable={false}
|
|
90
|
+
resumeTaskRequest={[Function]}
|
|
91
|
+
setForceUnlockModalOpen={[Function]}
|
|
92
|
+
setUnlockModalOpen={[Function]}
|
|
93
|
+
state="paused"
|
|
94
|
+
status="RESOLVED"
|
|
95
|
+
taskProgressToggle={[MockFunction]}
|
|
96
|
+
taskReload={true}
|
|
97
|
+
taskReloadStart={[MockFunction]}
|
|
98
|
+
unlockTaskRequest={[Function]}
|
|
99
|
+
/>
|
|
100
|
+
<TaskInfo
|
|
101
|
+
action=""
|
|
102
|
+
canEdit={true}
|
|
103
|
+
dynflowEnableConsole={true}
|
|
104
|
+
endedAt=""
|
|
105
|
+
errors={Array []}
|
|
106
|
+
forceCancelTaskRequest={[Function]}
|
|
107
|
+
hasSubTasks={true}
|
|
108
|
+
help=""
|
|
109
|
+
id="test"
|
|
110
|
+
output=""
|
|
111
|
+
parentTask="parent-id"
|
|
112
|
+
progress={0}
|
|
113
|
+
result="error"
|
|
114
|
+
startAt=""
|
|
115
|
+
startBefore=""
|
|
116
|
+
startedAt=""
|
|
117
|
+
state="paused"
|
|
118
|
+
status="RESOLVED"
|
|
119
|
+
taskProgressToggle={[MockFunction]}
|
|
120
|
+
taskReload={true}
|
|
121
|
+
taskReloadStart={[MockFunction]}
|
|
122
|
+
unlockTaskRequest={[Function]}
|
|
123
|
+
username=""
|
|
124
|
+
usernamePath=""
|
|
125
|
+
/>
|
|
148
126
|
</Fragment>
|
|
149
127
|
`;
|
|
@@ -2,7 +2,7 @@ import React from 'react';
|
|
|
2
2
|
import PropTypes from 'prop-types';
|
|
3
3
|
import classNames from 'classnames';
|
|
4
4
|
|
|
5
|
-
import { Button, Tooltip, TooltipPosition } from '@patternfly/react-core';
|
|
5
|
+
import { Button, Tooltip, TooltipPosition, Icon } from '@patternfly/react-core';
|
|
6
6
|
import { InfoCircleIcon } from '@patternfly/react-icons';
|
|
7
7
|
import { translate as __ } from 'foremanReact/common/I18n';
|
|
8
8
|
import {
|
|
@@ -25,8 +25,10 @@ export const OtherInfo = ({ updateQuery, otherCount, query }) => {
|
|
|
25
25
|
position={TooltipPosition.bottom}
|
|
26
26
|
>
|
|
27
27
|
<span>
|
|
28
|
-
<
|
|
29
|
-
|
|
28
|
+
<Icon isInline>
|
|
29
|
+
<InfoCircleIcon />
|
|
30
|
+
</Icon>{' '}
|
|
31
|
+
{__('Other:')}
|
|
30
32
|
</span>
|
|
31
33
|
</Tooltip>
|
|
32
34
|
<Button
|
|
@@ -1,14 +1,63 @@
|
|
|
1
|
-
import
|
|
1
|
+
import React from 'react';
|
|
2
|
+
import { render, screen, fireEvent } from '@testing-library/react';
|
|
3
|
+
import '@testing-library/jest-dom';
|
|
2
4
|
|
|
3
5
|
import { OtherInfo } from './OtherInfo';
|
|
6
|
+
import {
|
|
7
|
+
TASKS_DASHBOARD_AVAILABLE_QUERY_STATES,
|
|
8
|
+
TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS,
|
|
9
|
+
} from '../../../../TasksDashboardConstants';
|
|
4
10
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
+
jest.mock('foremanReact/common/I18n', () => ({
|
|
12
|
+
translate: str => str,
|
|
13
|
+
}));
|
|
14
|
+
|
|
15
|
+
const { STOPPED } = TASKS_DASHBOARD_AVAILABLE_QUERY_STATES;
|
|
16
|
+
const { OTHER } = TASKS_DASHBOARD_AVAILABLE_QUERY_RESULTS;
|
|
17
|
+
|
|
18
|
+
const defaultProps = {
|
|
19
|
+
updateQuery: jest.fn(),
|
|
20
|
+
otherCount: 7,
|
|
21
|
+
query: { state: STOPPED, result: OTHER },
|
|
11
22
|
};
|
|
12
23
|
|
|
13
|
-
describe('OtherInfo', () =>
|
|
14
|
-
|
|
24
|
+
describe('OtherInfo', () => {
|
|
25
|
+
beforeEach(() => {
|
|
26
|
+
defaultProps.updateQuery.mockClear();
|
|
27
|
+
});
|
|
28
|
+
|
|
29
|
+
it('renders Other label, count', () => {
|
|
30
|
+
render(<OtherInfo {...defaultProps} />);
|
|
31
|
+
expect(screen.getByText('Other:')).toBeInTheDocument();
|
|
32
|
+
expect(screen.getByText('7')).toBeInTheDocument();
|
|
33
|
+
});
|
|
34
|
+
|
|
35
|
+
it('calls updateQuery with STOPPED and OTHER when the count button is clicked', () => {
|
|
36
|
+
render(<OtherInfo {...defaultProps} />);
|
|
37
|
+
const button = screen.getByRole('button', { name: '7' });
|
|
38
|
+
fireEvent.click(button);
|
|
39
|
+
expect(defaultProps.updateQuery).toHaveBeenCalledWith({
|
|
40
|
+
state: STOPPED,
|
|
41
|
+
result: OTHER,
|
|
42
|
+
});
|
|
43
|
+
});
|
|
44
|
+
|
|
45
|
+
it('applies other-active class when query state is STOPPED and result is OTHER', () => {
|
|
46
|
+
const { container } = render(
|
|
47
|
+
<OtherInfo {...defaultProps} query={{ state: STOPPED, result: OTHER }} />
|
|
48
|
+
);
|
|
49
|
+
const wrapper = container.querySelector('.other-active');
|
|
50
|
+
expect(wrapper).toBeInTheDocument();
|
|
51
|
+
});
|
|
52
|
+
|
|
53
|
+
it('does not apply other-active class when query result is not OTHER', () => {
|
|
54
|
+
const { container } = render(
|
|
55
|
+
<OtherInfo
|
|
56
|
+
{...defaultProps}
|
|
57
|
+
query={{ state: STOPPED, result: 'error' }}
|
|
58
|
+
/>
|
|
59
|
+
);
|
|
60
|
+
const wrapper = container.querySelector('.other-active');
|
|
61
|
+
expect(wrapper).not.toBeInTheDocument();
|
|
62
|
+
});
|
|
63
|
+
});
|
|
@@ -1,19 +1,5 @@
|
|
|
1
1
|
.stopped-tasks-card {
|
|
2
2
|
.stopped-table {
|
|
3
|
-
width: 100%;
|
|
4
|
-
border: none;
|
|
5
|
-
table-layout: fixed;
|
|
6
|
-
|
|
7
|
-
thead {
|
|
8
|
-
background-color: transparent;
|
|
9
|
-
background-image: none;
|
|
10
|
-
tr {
|
|
11
|
-
th {
|
|
12
|
-
font-weight: bold;
|
|
13
|
-
border: none;
|
|
14
|
-
}
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
3
|
|
|
18
4
|
td,
|
|
19
5
|
th {
|
|
@@ -29,12 +15,6 @@
|
|
|
29
15
|
td {
|
|
30
16
|
&.active {
|
|
31
17
|
font-weight: bold;
|
|
32
|
-
}
|
|
33
|
-
}
|
|
34
|
-
.data-col {
|
|
35
|
-
&:hover {
|
|
36
|
-
cursor: pointer;
|
|
37
|
-
border: 1px solid #d1d1d1;
|
|
38
18
|
background-color: #def3fe;
|
|
39
19
|
}
|
|
40
20
|
}
|
|
@@ -43,14 +23,4 @@
|
|
|
43
23
|
.other-active {
|
|
44
24
|
text-decoration: underline;
|
|
45
25
|
}
|
|
46
|
-
|
|
47
|
-
.pficon {
|
|
48
|
-
margin-right: 5px;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
.btn-link {
|
|
52
|
-
font-size: 14px;
|
|
53
|
-
padding-top: 0;
|
|
54
|
-
padding-bottom: 0;
|
|
55
|
-
}
|
|
56
26
|
}
|