foreman-tasks 2.0.3 → 3.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.github/workflows/js_tests.yml +27 -0
- data/.github/workflows/ruby_tests.yml +74 -0
- data/.rubocop.yml +12 -4
- data/.rubocop_todo.yml +32 -25
- data/Gemfile +5 -0
- data/app/controllers/foreman_tasks/api/tasks_controller.rb +31 -58
- data/app/controllers/foreman_tasks/concerns/parameters/triggering.rb +1 -1
- data/app/controllers/foreman_tasks/recurring_logics_controller.rb +7 -0
- data/app/helpers/foreman_tasks/foreman_tasks_helper.rb +3 -3
- data/app/models/foreman_tasks/recurring_logic.rb +4 -4
- data/app/models/foreman_tasks/task.rb +11 -0
- data/app/models/foreman_tasks/task/dynflow_task.rb +27 -33
- data/app/models/foreman_tasks/task/status_explicator.rb +1 -1
- data/app/models/foreman_tasks/triggering.rb +1 -1
- data/app/models/setting/foreman_tasks.rb +1 -1
- data/app/views/foreman_tasks/api/tasks/index.json.rabl +2 -0
- data/app/views/foreman_tasks/recurring_logics/index.html.erb +3 -1
- data/config/routes.rb +2 -1
- data/db/migrate/20200517215015_rename_bookmarks_controller.rb +2 -2
- data/db/seeds.d/30-notification_blueprints.rb +7 -7
- data/db/seeds.d/61-foreman_tasks_bookmarks.rb +1 -1
- data/lib/foreman_tasks/cleaner.rb +4 -6
- data/lib/foreman_tasks/dynflow/configuration.rb +1 -1
- data/lib/foreman_tasks/dynflow/persistence.rb +4 -6
- data/lib/foreman_tasks/engine.rb +2 -2
- data/lib/foreman_tasks/version.rb +1 -1
- data/package.json +0 -1
- data/test/controllers/api/recurring_logics_controller_test.rb +1 -1
- data/test/controllers/api/tasks_controller_test.rb +7 -7
- data/test/controllers/tasks_controller_test.rb +6 -6
- data/test/core/unit/runner_test.rb +20 -20
- data/test/core/unit/task_launcher_test.rb +8 -8
- data/test/helpers/foreman_tasks/foreman_tasks_helper_test.rb +7 -7
- data/test/helpers/foreman_tasks/tasks_helper_test.rb +3 -3
- data/test/lib/actions/middleware/keep_current_request_id_test.rb +3 -3
- data/test/support/history_tasks_builder.rb +1 -1
- data/test/tasks/generate_task_actions_test.rb +1 -1
- data/test/unit/actions/action_with_sub_plans_test.rb +2 -2
- data/test/unit/actions/bulk_action_test.rb +6 -6
- data/test/unit/actions/proxy_action_test.rb +20 -20
- data/test/unit/actions/recurring_action_test.rb +30 -32
- data/test/unit/cleaner_test.rb +24 -24
- data/test/unit/dashboard_table_filter_test.rb +5 -5
- data/test/unit/otp_manager_test.rb +2 -2
- data/test/unit/proxy_selector_test.rb +9 -9
- data/test/unit/recurring_logic_test.rb +32 -38
- data/test/unit/remote_task_test.rb +2 -2
- data/test/unit/task_groups_test.rb +4 -4
- data/test/unit/task_test.rb +18 -18
- data/test/unit/triggering_test.rb +8 -8
- data/test/unit/troubleshooting_help_generator_test.rb +6 -6
- data/test/unit/ui_notifications_test.rb +11 -11
- data/webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js +3 -3
- data/webpack/ForemanTasks/Components/TaskDetails/Components/Task.js +8 -157
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js +168 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js +6 -7
- data/webpack/ForemanTasks/Components/TaskDetails/Components/TaskSkeleton.js +48 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js +1 -1
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js +12 -70
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js +95 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap +78 -225
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap +212 -0
- data/webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap +8 -4
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js +87 -70
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js +48 -125
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js +3 -16
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js +55 -29
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js +2 -2
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js +6 -0
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js +2 -18
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap +77 -27
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap +14 -101
- data/webpack/ForemanTasks/Components/TaskDetails/index.js +6 -3
- data/webpack/ForemanTasks/Components/common/urlHelpers.js +7 -0
- data/webpack/ForemanTasks/ForemanTasksReducers.js +0 -2
- data/webpack/__mocks__/foremanReact/common/helpers.js +2 -0
- data/webpack/__mocks__/foremanReact/redux/API/APISelectors.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/API/index.js +10 -0
- data/webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js +5 -0
- metadata +17 -14
- data/.travis.yml +0 -7
- data/script/travis_run_js_tests.sh +0 -7
- data/webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js +0 -38
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js +0 -33
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap +0 -26
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap +0 -122
- data/webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js +0 -72
- data/webpack/__mocks__/foremanReact/redux/API.js +0 -7
@@ -3,7 +3,6 @@ import { connect } from 'react-redux';
|
|
3
3
|
import TaskDetails from './TaskDetails';
|
4
4
|
import * as taskDetailsActions from './TaskDetailsActions';
|
5
5
|
import * as taskActions from '../TaskActions';
|
6
|
-
import reducer from './TaskDetailsReducer';
|
7
6
|
import {
|
8
7
|
selectEndedAt,
|
9
8
|
selectStartAt,
|
@@ -33,6 +32,9 @@ import {
|
|
33
32
|
selectExternalId,
|
34
33
|
selectDynflowEnableConsole,
|
35
34
|
selectCanEdit,
|
35
|
+
selectStatus,
|
36
|
+
selectAPIError,
|
37
|
+
selectIsLoading,
|
36
38
|
} from './TaskDetailsSelectors';
|
37
39
|
|
38
40
|
const mapStateToProps = state => ({
|
@@ -64,11 +66,12 @@ const mapStateToProps = state => ({
|
|
64
66
|
externalId: selectExternalId(state),
|
65
67
|
dynflowEnableConsole: selectDynflowEnableConsole(state),
|
66
68
|
canEdit: selectCanEdit(state),
|
69
|
+
status: selectStatus(state),
|
70
|
+
APIerror: selectAPIError(state),
|
71
|
+
isLoading: selectIsLoading(state),
|
67
72
|
});
|
68
73
|
|
69
74
|
const mapDispatchToProps = dispatch =>
|
70
75
|
bindActionCreators({ ...taskActions, ...taskDetailsActions }, dispatch);
|
71
76
|
|
72
|
-
export const reducers = { taskDetails: reducer };
|
73
|
-
|
74
77
|
export default connect(mapStateToProps, mapDispatchToProps)(TaskDetails);
|
@@ -1,13 +1,11 @@
|
|
1
1
|
import { combineReducers } from 'redux';
|
2
2
|
import { reducers as tasksDashboardReducers } from './Components/TasksDashboard';
|
3
|
-
import { reducers as taskDetailsReducers } from './Components/TaskDetails';
|
4
3
|
import { reducers as tasksTableReducers } from './Components/TasksTable';
|
5
4
|
import { reducers as confirmModalReducers } from './Components/TasksTable/Components/ConfirmModal';
|
6
5
|
|
7
6
|
const reducers = {
|
8
7
|
foremanTasks: combineReducers({
|
9
8
|
...tasksDashboardReducers,
|
10
|
-
...taskDetailsReducers,
|
11
9
|
...tasksTableReducers,
|
12
10
|
...confirmModalReducers,
|
13
11
|
}),
|
@@ -0,0 +1,10 @@
|
|
1
|
+
export const selectAPIResponse = (state, key) => ({
|
2
|
+
data: {
|
3
|
+
text: 'some-data',
|
4
|
+
key,
|
5
|
+
},
|
6
|
+
});
|
7
|
+
|
8
|
+
export const selectAPIStatus = (state, key) => 'PENDING';
|
9
|
+
export const selectAPIByKey = (state, key) => state[key];
|
10
|
+
export const selectAPIError = (state, key) => ({ error: `${key} ERRROR` });
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: foreman-tasks
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version:
|
4
|
+
version: 3.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ivan Nečas
|
8
|
-
autorequire:
|
8
|
+
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2020-09-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: dynflow
|
@@ -122,12 +122,13 @@ extra_rdoc_files:
|
|
122
122
|
- LICENSE
|
123
123
|
files:
|
124
124
|
- ".eslintrc"
|
125
|
+
- ".github/workflows/js_tests.yml"
|
126
|
+
- ".github/workflows/ruby_tests.yml"
|
125
127
|
- ".gitignore"
|
126
128
|
- ".prettierrc"
|
127
129
|
- ".rubocop.yml"
|
128
130
|
- ".rubocop_todo.yml"
|
129
131
|
- ".stylelintrc"
|
130
|
-
- ".travis.yml"
|
131
132
|
- ".tx/config"
|
132
133
|
- ".yo-rc.json"
|
133
134
|
- Gemfile
|
@@ -210,6 +211,7 @@ files:
|
|
210
211
|
- app/views/foreman_tasks/api/recurring_logics/show.json.rabl
|
211
212
|
- app/views/foreman_tasks/api/recurring_logics/update.json.rabl
|
212
213
|
- app/views/foreman_tasks/api/tasks/details.json.rabl
|
214
|
+
- app/views/foreman_tasks/api/tasks/index.json.rabl
|
213
215
|
- app/views/foreman_tasks/api/tasks/show.json.rabl
|
214
216
|
- app/views/foreman_tasks/layouts/react.html.erb
|
215
217
|
- app/views/foreman_tasks/recurring_logics/_tab_related.html.erb
|
@@ -292,7 +294,6 @@ files:
|
|
292
294
|
- package.json
|
293
295
|
- script/npm_link_foreman_js.sh
|
294
296
|
- script/rails
|
295
|
-
- script/travis_run_js_tests.sh
|
296
297
|
- test/controllers/api/recurring_logics_controller_test.rb
|
297
298
|
- test/controllers/api/tasks_controller_test.rb
|
298
299
|
- test/controllers/recurring_logics_controller_test.rb
|
@@ -353,13 +354,16 @@ files:
|
|
353
354
|
- webpack/ForemanTasks/Components/TaskDetails/Components/Raw.js
|
354
355
|
- webpack/ForemanTasks/Components/TaskDetails/Components/RunningSteps.js
|
355
356
|
- webpack/ForemanTasks/Components/TaskDetails/Components/Task.js
|
357
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskButtons.js
|
356
358
|
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskHelper.js
|
357
359
|
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskInfo.js
|
360
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/TaskSkeleton.js
|
358
361
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Errors.test.js
|
359
362
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Locks.test.js
|
360
363
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Raw.test.js
|
361
364
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/RunningSteps.test.js
|
362
365
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/Task.test.js
|
366
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskButtons.test.js
|
363
367
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskHelper.test.js
|
364
368
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/TaskInfo.test.js
|
365
369
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Errors.test.js.snap
|
@@ -367,24 +371,20 @@ files:
|
|
367
371
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Raw.test.js.snap
|
368
372
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/RunningSteps.test.js.snap
|
369
373
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/Task.test.js.snap
|
374
|
+
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskButtons.test.js.snap
|
370
375
|
- webpack/ForemanTasks/Components/TaskDetails/Components/__tests__/__snapshots__/TaskInfo.test.js.snap
|
371
376
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.js
|
372
377
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.scss
|
373
378
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetails.stories.js
|
374
379
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsActions.js
|
375
380
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsConstants.js
|
376
|
-
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsReducer.js
|
377
381
|
- webpack/ForemanTasks/Components/TaskDetails/TaskDetailsSelectors.js
|
378
382
|
- webpack/ForemanTasks/Components/TaskDetails/TasksDetailsHelper.js
|
379
383
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.fixtures.js
|
380
384
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetails.test.js
|
381
385
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsActions.test.js
|
382
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/TaskDetailsReducer.test.js
|
383
386
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetails.test.js.snap
|
384
387
|
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsActions.test.js.snap
|
385
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/TaskDetailsReducer.test.js.snap
|
386
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap
|
387
|
-
- webpack/ForemanTasks/Components/TaskDetails/__tests__/integration.test.js
|
388
388
|
- webpack/ForemanTasks/Components/TaskDetails/index.js
|
389
389
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.js
|
390
390
|
- webpack/ForemanTasks/Components/TasksDashboard/Components/TasksCardsGrid/Components/PausedTasksCard/PausedTasksCard.stories.js
|
@@ -538,6 +538,7 @@ files:
|
|
538
538
|
- webpack/ForemanTasks/Components/common/ClickConfirmation/index.js
|
539
539
|
- webpack/ForemanTasks/Components/common/ToastsHelpers/ToastTypesConstants.js
|
540
540
|
- webpack/ForemanTasks/Components/common/ToastsHelpers/index.js
|
541
|
+
- webpack/ForemanTasks/Components/common/urlHelpers.js
|
541
542
|
- webpack/ForemanTasks/ForemanTasks.js
|
542
543
|
- webpack/ForemanTasks/ForemanTasks.test.js
|
543
544
|
- webpack/ForemanTasks/ForemanTasksReducers.js
|
@@ -570,8 +571,10 @@ files:
|
|
570
571
|
- webpack/__mocks__/foremanReact/components/common/table.js
|
571
572
|
- webpack/__mocks__/foremanReact/components/common/table/actionsHelpers/actionTypeCreator.js
|
572
573
|
- webpack/__mocks__/foremanReact/constants.js
|
573
|
-
- webpack/__mocks__/foremanReact/redux/API.js
|
574
|
+
- webpack/__mocks__/foremanReact/redux/API/APISelectors.js
|
575
|
+
- webpack/__mocks__/foremanReact/redux/API/index.js
|
574
576
|
- webpack/__mocks__/foremanReact/redux/actions/toasts.js
|
577
|
+
- webpack/__mocks__/foremanReact/redux/middlewares/IntervalMiddleware.js
|
575
578
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/PageLayout.js
|
576
579
|
- webpack/__mocks__/foremanReact/routes/common/PageLayout/components/ExportButton/ExportButton.js
|
577
580
|
- webpack/index.js
|
@@ -580,7 +583,7 @@ files:
|
|
580
583
|
homepage: https://github.com/theforeman/foreman-tasks
|
581
584
|
licenses: []
|
582
585
|
metadata: {}
|
583
|
-
post_install_message:
|
586
|
+
post_install_message:
|
584
587
|
rdoc_options: []
|
585
588
|
require_paths:
|
586
589
|
- lib
|
@@ -595,8 +598,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
595
598
|
- !ruby/object:Gem::Version
|
596
599
|
version: '0'
|
597
600
|
requirements: []
|
598
|
-
rubygems_version: 3.
|
599
|
-
signing_key:
|
601
|
+
rubygems_version: 3.0.3
|
602
|
+
signing_key:
|
600
603
|
specification_version: 4
|
601
604
|
summary: Foreman plugin for showing tasks information for resources and users
|
602
605
|
test_files:
|
data/.travis.yml
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
import Immutable from 'seamless-immutable';
|
2
|
-
import {
|
3
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST,
|
4
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
5
|
-
FOREMAN_TASK_DETAILS_STOP_POLLING,
|
6
|
-
FOREMAN_TASK_DETAILS_START_POLLING,
|
7
|
-
} from './TaskDetailsConstants';
|
8
|
-
|
9
|
-
const initialState = Immutable({});
|
10
|
-
|
11
|
-
export default (state = initialState, action) => {
|
12
|
-
const { type, payload } = action;
|
13
|
-
let { taskReload, timeoutId } = state;
|
14
|
-
|
15
|
-
switch (type) {
|
16
|
-
case FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST:
|
17
|
-
return state.set('loading', true);
|
18
|
-
case FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS:
|
19
|
-
if (payload.state === 'stopped') {
|
20
|
-
clearTimeout(state.timeoutId);
|
21
|
-
taskReload = false;
|
22
|
-
timeoutId = null;
|
23
|
-
}
|
24
|
-
return state.merge({
|
25
|
-
loading: false,
|
26
|
-
...payload,
|
27
|
-
taskReload,
|
28
|
-
timeoutId,
|
29
|
-
});
|
30
|
-
case FOREMAN_TASK_DETAILS_STOP_POLLING:
|
31
|
-
return state.merge({ taskReload: false, timeoutId: null });
|
32
|
-
case FOREMAN_TASK_DETAILS_START_POLLING:
|
33
|
-
clearTimeout(state.timeoutId);
|
34
|
-
return state.merge({ taskReload: true, timeoutId: payload.timeoutId });
|
35
|
-
default:
|
36
|
-
return state;
|
37
|
-
}
|
38
|
-
};
|
@@ -1,33 +0,0 @@
|
|
1
|
-
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
2
|
-
|
3
|
-
import {
|
4
|
-
FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
5
|
-
FOREMAN_TASK_DETAILS_STOP_POLLING,
|
6
|
-
FOREMAN_TASK_DETAILS_START_POLLING,
|
7
|
-
} from '../TaskDetailsConstants';
|
8
|
-
import reducer from '../TaskDetailsReducer';
|
9
|
-
|
10
|
-
const fixtures = {
|
11
|
-
'should return the initial state': {},
|
12
|
-
'should handle FOREMAN_TASK_DETAILS_START_POLLING': {
|
13
|
-
action: {
|
14
|
-
type: FOREMAN_TASK_DETAILS_START_POLLING,
|
15
|
-
payload: { timeoutId: 1 },
|
16
|
-
},
|
17
|
-
},
|
18
|
-
'should handle FOREMAN_TASK_DETAILS_STOP_POLLING': {
|
19
|
-
action: {
|
20
|
-
type: FOREMAN_TASK_DETAILS_STOP_POLLING,
|
21
|
-
payload: { timeoutId: 1 },
|
22
|
-
},
|
23
|
-
},
|
24
|
-
'should handle FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS': {
|
25
|
-
action: {
|
26
|
-
type: FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS,
|
27
|
-
payload: { data: 'some-payload' },
|
28
|
-
},
|
29
|
-
},
|
30
|
-
};
|
31
|
-
|
32
|
-
describe('TaskDetails - Reducer', () =>
|
33
|
-
testReducerSnapshotWithFixtures(reducer, fixtures));
|
@@ -1,26 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS 1`] = `
|
4
|
-
Object {
|
5
|
-
"data": "some-payload",
|
6
|
-
"loading": false,
|
7
|
-
"taskReload": undefined,
|
8
|
-
"timeoutId": undefined,
|
9
|
-
}
|
10
|
-
`;
|
11
|
-
|
12
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_START_POLLING 1`] = `
|
13
|
-
Object {
|
14
|
-
"taskReload": true,
|
15
|
-
"timeoutId": 1,
|
16
|
-
}
|
17
|
-
`;
|
18
|
-
|
19
|
-
exports[`TaskDetails - Reducer should handle FOREMAN_TASK_DETAILS_STOP_POLLING 1`] = `
|
20
|
-
Object {
|
21
|
-
"taskReload": false,
|
22
|
-
"timeoutId": null,
|
23
|
-
}
|
24
|
-
`;
|
25
|
-
|
26
|
-
exports[`TaskDetails - Reducer should return the initial state 1`] = `Object {}`;
|
data/webpack/ForemanTasks/Components/TaskDetails/__tests__/__snapshots__/integration.test.js.snap
DELETED
@@ -1,122 +0,0 @@
|
|
1
|
-
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
2
|
-
|
3
|
-
exports[`TaskDetails integration test should change the data after reload: task details data should change 1`] = `
|
4
|
-
Object {
|
5
|
-
"action": Array [
|
6
|
-
Array [
|
7
|
-
Object {
|
8
|
-
"payload": Object {
|
9
|
-
"timeoutId": 1,
|
10
|
-
},
|
11
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
12
|
-
},
|
13
|
-
],
|
14
|
-
],
|
15
|
-
"state": Object {
|
16
|
-
"taskDetails": Object {
|
17
|
-
"label": "new-label",
|
18
|
-
"loading": false,
|
19
|
-
"taskReload": true,
|
20
|
-
"timeoutId": 1,
|
21
|
-
},
|
22
|
-
},
|
23
|
-
}
|
24
|
-
`;
|
25
|
-
|
26
|
-
exports[`TaskDetails integration test should change the data after reload: task details reload start without error 1`] = `
|
27
|
-
Array [
|
28
|
-
Array [
|
29
|
-
Object {
|
30
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
31
|
-
},
|
32
|
-
],
|
33
|
-
Array [
|
34
|
-
Object {
|
35
|
-
"payload": Object {
|
36
|
-
"timeoutId": 1,
|
37
|
-
},
|
38
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
39
|
-
},
|
40
|
-
],
|
41
|
-
Array [
|
42
|
-
Object {
|
43
|
-
"payload": Object {
|
44
|
-
"label": "new-label",
|
45
|
-
},
|
46
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_SUCCESS",
|
47
|
-
},
|
48
|
-
],
|
49
|
-
Array [
|
50
|
-
Object {
|
51
|
-
"payload": Object {
|
52
|
-
"timeoutId": 1,
|
53
|
-
},
|
54
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
55
|
-
},
|
56
|
-
],
|
57
|
-
]
|
58
|
-
`;
|
59
|
-
|
60
|
-
exports[`TaskDetails integration test should flow: initial state 1`] = `
|
61
|
-
Object {
|
62
|
-
"taskDetails": Object {
|
63
|
-
"loading": true,
|
64
|
-
},
|
65
|
-
}
|
66
|
-
`;
|
67
|
-
|
68
|
-
exports[`TaskDetails integration test should flow: task details reload start with error 1`] = `
|
69
|
-
Array [
|
70
|
-
Array [
|
71
|
-
Object {
|
72
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
73
|
-
},
|
74
|
-
],
|
75
|
-
Array [
|
76
|
-
Object {
|
77
|
-
"payload": Object {
|
78
|
-
"timeoutId": 1,
|
79
|
-
},
|
80
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
81
|
-
},
|
82
|
-
],
|
83
|
-
Array [
|
84
|
-
Object {
|
85
|
-
"payload": [TypeError: Cannot read property 'data' of undefined],
|
86
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_FAILURE",
|
87
|
-
},
|
88
|
-
],
|
89
|
-
]
|
90
|
-
`;
|
91
|
-
|
92
|
-
exports[`TaskDetails integration test should flow: task details reload stop 1`] = `
|
93
|
-
Array [
|
94
|
-
Array [
|
95
|
-
Object {
|
96
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_REQUEST",
|
97
|
-
},
|
98
|
-
],
|
99
|
-
Array [
|
100
|
-
Object {
|
101
|
-
"payload": Object {
|
102
|
-
"timeoutId": 1,
|
103
|
-
},
|
104
|
-
"type": "FOREMAN_TASK_DETAILS_START_POLLING",
|
105
|
-
},
|
106
|
-
],
|
107
|
-
Array [
|
108
|
-
Object {
|
109
|
-
"payload": [TypeError: Cannot read property 'data' of undefined],
|
110
|
-
"type": "FOREMAN_TASK_DETAILS_FETCH_TASK_FAILURE",
|
111
|
-
},
|
112
|
-
],
|
113
|
-
Array [
|
114
|
-
Object {
|
115
|
-
"payload": Object {
|
116
|
-
"timeoutId": 1,
|
117
|
-
},
|
118
|
-
"type": "FOREMAN_TASK_DETAILS_STOP_POLLING",
|
119
|
-
},
|
120
|
-
],
|
121
|
-
]
|
122
|
-
`;
|