foreman_rh_cloud 13.2.11 → 14.0.1
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/app/assets/javascripts/foreman_rh_cloud/locale/fr/foreman_rh_cloud.js +61 -61
- data/app/assets/javascripts/foreman_rh_cloud/locale/ja/foreman_rh_cloud.js +68 -68
- data/app/assets/javascripts/foreman_rh_cloud/locale/ka/foreman_rh_cloud.js +9 -9
- data/app/assets/javascripts/foreman_rh_cloud/locale/ko/foreman_rh_cloud.js +60 -60
- data/app/assets/javascripts/foreman_rh_cloud/locale/zh_CN/foreman_rh_cloud.js +60 -60
- data/app/controllers/concerns/insights_cloud/package_profile_upload_extensions.rb +0 -9
- data/app/controllers/insights_cloud/api/machine_telemetries_controller.rb +10 -13
- data/app/controllers/insights_cloud/ui_requests_controller.rb +7 -3
- data/app/models/concerns/rh_cloud_host.rb +4 -71
- data/app/models/insights_client_report_status.rb +1 -9
- data/app/models/inventory_sync/inventory_status.rb +4 -16
- data/app/services/foreman_rh_cloud/insights_api_forwarder.rb +5 -12
- data/app/services/foreman_rh_cloud/url_remediations_retriever.rb +5 -19
- data/lib/foreman_inventory_upload/async/create_missing_insights_facets.rb +2 -8
- data/lib/foreman_inventory_upload/async/upload_report_direct_job.rb +0 -2
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +4 -34
- data/lib/foreman_inventory_upload/generators/queries.rb +1 -1
- data/lib/foreman_inventory_upload/generators/slice.rb +1 -1
- data/lib/foreman_inventory_upload.rb +1 -8
- data/lib/foreman_rh_cloud/engine.rb +0 -1
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/lib/foreman_rh_cloud.rb +9 -36
- data/lib/insights_cloud/async/insights_generate_notifications.rb +1 -10
- data/lib/insights_cloud/async/vmaas_reposcan_sync.rb +8 -23
- data/lib/inventory_sync/async/inventory_full_sync.rb +3 -39
- data/lib/inventory_sync/async/inventory_self_host_sync.rb +2 -12
- data/locale/fr/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/fr/foreman_rh_cloud.edit.po +1032 -0
- data/locale/fr/foreman_rh_cloud.po +65 -66
- data/locale/fr/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ja/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ja/foreman_rh_cloud.edit.po +1026 -0
- data/locale/ja/foreman_rh_cloud.po +70 -72
- data/locale/ja/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ka/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ka/foreman_rh_cloud.edit.po +1025 -0
- data/locale/ka/foreman_rh_cloud.po +10 -11
- data/locale/ka/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/ko/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/ko/foreman_rh_cloud.edit.po +1029 -0
- data/locale/ko/foreman_rh_cloud.po +63 -64
- data/locale/ko/foreman_rh_cloud.po.time_stamp +0 -0
- data/locale/zh_CN/LC_MESSAGES/foreman_rh_cloud.mo +0 -0
- data/locale/zh_CN/foreman_rh_cloud.edit.po +1031 -0
- data/locale/zh_CN/foreman_rh_cloud.po +64 -65
- data/locale/zh_CN/foreman_rh_cloud.po.time_stamp +0 -0
- data/package.json +1 -1
- data/test/controllers/insights_cloud/api/machine_telemetries_controller_test.rb +3 -57
- data/test/controllers/insights_cloud/ui_requests_controller_test.rb +2 -16
- data/test/jobs/insights_client_status_aging_test.rb +0 -40
- data/test/jobs/inventory_full_sync_test.rb +4 -219
- data/test/jobs/inventory_hosts_sync_test.rb +5 -7
- data/test/jobs/inventory_self_host_sync_test.rb +1 -10
- data/test/jobs/upload_report_direct_job_test.rb +0 -29
- data/test/models/insights_client_report_status_test.rb +0 -109
- data/test/unit/archived_report_generator_test.rb +1 -2
- data/test/unit/fact_helpers_test.rb +0 -16
- data/test/unit/foreman_rh_cloud_self_host_test.rb +2 -50
- data/test/unit/insights_facet_test.rb +0 -5
- data/test/unit/lib/insights_cloud/async/vmaas_reposcan_sync_test.rb +25 -80
- data/test/unit/metadata_generator_test.rb +1 -24
- data/test/unit/rh_cloud_host_test.rb +0 -282
- data/test/unit/services/foreman_rh_cloud/branch_info_test.rb +1 -1
- data/test/unit/services/foreman_rh_cloud/cloud_request_forwarder_test.rb +1 -1
- data/test/unit/services/foreman_rh_cloud/url_remediations_retriever_test.rb +5 -82
- data/test/unit/slice_generator_test.rb +2 -21
- data/webpack/CVEsHostDetailsTab/CVEsHostDetailsTab.js +3 -30
- data/webpack/CVEsHostDetailsTab/__tests__/CVEsHostDetailsTab.test.js +10 -112
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +9 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +9 -13
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/__snapshots__/EmptyState.test.js.snap +25 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +9 -20
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/__snapshots__/ErrorState.test.js.snap +20 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +8 -31
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/__snapshots__/ListItem.test.js.snap +47 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +10 -26
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/__snapshots__/ListItemStatus.test.js.snap +59 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +9 -33
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +34 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +35 -55
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +25 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +49 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListActions.test.js.snap +86 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListReducer.test.js.snap +75 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountListSelectors.test.js.snap +46 -0
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +9 -13
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/__snapshots__/FileDownload.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +15 -12
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +28 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterActions.test.js.snap +17 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterReducer.test.js.snap +19 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilterSelectors.test.js.snap +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/integration.test.js.snap +43 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +12 -32
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/AdvancedSettingActions.test.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/AdvancedSetting/__tests__/__snapshots__/AdvancedSettingActions.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/InventorySettingsActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventorySettings/__tests__/__snapshots__/InventorySettingsActions.test.js.snap +26 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageTitle.test.js +7 -15
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageTitle.test.js.snap +68 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorActions.test.js +9 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/CloudConnectorButton.test.js +18 -47
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorActions.test.js.snap +11 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/CloudConnectorButton/__tests__/__snapshots__/CloudConnectorButton.test.js.snap +59 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/PageDescription/PageDescription.js +1 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/SettingsWarning.test.js +15 -58
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SettingsWarning/__snapshots__/SettingsWarning.test.js.snap +32 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/SyncButtonActions.js +2 -8
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButton.test.js +9 -23
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/SyncButtonSelectors.test.js +17 -19
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButton.test.js.snap +15 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/SyncButtonSelectors.test.js.snap +3 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/__snapshots__/integrations.test.js.snap +57 -0
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/__tests__/integrations.test.js +36 -25
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/Toast.js +17 -43
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +8 -28
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/__snapshots__/ScheduledRun.test.js.snap +23 -0
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +8 -25
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/__snapshots__/StatusChart.test.js.snap +74 -0
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +9 -11
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/__snapshots__/TabContainer.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +9 -11
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/__snapshots__/TabFooter.test.js.snap +12 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +1 -8
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/InventoryAutoUpload.test.js +12 -33
- data/webpack/ForemanInventoryUpload/SubscriptionsPageExtension/InventoryAutoUpload/__tests__/__snapshots__/InventoryAutoUpload.test.js.snap +96 -0
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +8 -36
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryUpload.test.js +10 -0
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +5 -0
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryUpload.test.js.snap +14 -0
- data/webpack/ForemanRhCloudHelpers.js +0 -22
- data/webpack/InsightsHostDetailsTab/NewHostDetailsTab.js +15 -71
- metadata +57 -18
- data/app/controllers/concerns/insights_cloud/candlepin_proxies_extensions.rb +0 -23
- data/test/controllers/insights_cloud/candlepin_proxies_extensions_test.rb +0 -70
- data/test/jobs/insights_generate_notifications_test.rb +0 -26
- data/test/models/inventory_sync/inventory_status_test.rb +0 -85
- data/webpack/ForemanInventoryUpload/Components/PageHeader/components/SyncButton/components/__tests__/Toast.test.js +0 -82
- data/webpack/InsightsHostDetailsTab/__tests__/NewHostDetailsTab.test.js +0 -266
data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
+
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
1
3
|
import {
|
|
2
4
|
INVENTORY_ACCOUNT_STATUS_POLLING,
|
|
3
5
|
INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
|
@@ -12,67 +14,45 @@ import {
|
|
|
12
14
|
accountID,
|
|
13
15
|
processStatusName,
|
|
14
16
|
pollingResponse,
|
|
15
|
-
accounts,
|
|
16
|
-
CloudConnectorStatus,
|
|
17
17
|
} from '../AccountList.fixtures';
|
|
18
18
|
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
expect(state.pollingProcessID).toBe(0);
|
|
24
|
-
expect(state.error).toBeNull();
|
|
25
|
-
});
|
|
26
|
-
|
|
27
|
-
it('handles INVENTORY_ACCOUNT_STATUS_POLLING', () => {
|
|
28
|
-
const state = reducer(undefined, {
|
|
19
|
+
const fixtures = {
|
|
20
|
+
'should return the initial state': {},
|
|
21
|
+
'should handle INVENTORY_ACCOUNT_STATUS_POLLING': {
|
|
22
|
+
action: {
|
|
29
23
|
type: INVENTORY_ACCOUNT_STATUS_POLLING,
|
|
30
24
|
payload: pollingResponse,
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('handles INVENTORY_ACCOUNT_STATUS_POLLING_ERROR', () => {
|
|
38
|
-
const state = reducer(undefined, {
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
'should handle INVENTORY_ACCOUNT_STATUS_POLLING_ERROR': {
|
|
28
|
+
action: {
|
|
39
29
|
type: INVENTORY_ACCOUNT_STATUS_POLLING_ERROR,
|
|
40
30
|
payload: { error },
|
|
41
|
-
}
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
it('handles INVENTORY_ACCOUNT_STATUS_POLLING_START', () => {
|
|
47
|
-
const state = reducer(undefined, {
|
|
48
|
-
type: INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
|
49
|
-
payload: { pollingProcessID },
|
|
50
|
-
});
|
|
51
|
-
expect(state.pollingProcessID).toBe(pollingProcessID);
|
|
52
|
-
});
|
|
53
|
-
|
|
54
|
-
it('handles INVENTORY_ACCOUNT_STATUS_POLLING_STOP (default case)', () => {
|
|
55
|
-
const prevState = reducer(undefined, {
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
|
+
'should handle INVENTORY_ACCOUNT_STATUS_POLLING_START': {
|
|
34
|
+
action: {
|
|
56
35
|
type: INVENTORY_ACCOUNT_STATUS_POLLING_START,
|
|
57
|
-
payload: {
|
|
58
|
-
|
|
59
|
-
|
|
36
|
+
payload: {
|
|
37
|
+
pollingProcessID,
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
'should handle INVENTORY_ACCOUNT_STATUS_POLLING_STOP': {
|
|
42
|
+
action: {
|
|
60
43
|
type: INVENTORY_ACCOUNT_STATUS_POLLING_STOP,
|
|
61
|
-
}
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
});
|
|
66
|
-
|
|
67
|
-
it('handles INVENTORY_PROCESS_RESTART', () => {
|
|
68
|
-
const stateWithAccounts = reducer(undefined, {
|
|
69
|
-
type: INVENTORY_ACCOUNT_STATUS_POLLING,
|
|
70
|
-
payload: pollingResponse,
|
|
71
|
-
});
|
|
72
|
-
const state = reducer(stateWithAccounts, {
|
|
44
|
+
},
|
|
45
|
+
},
|
|
46
|
+
'should handle INVENTORY_PROCESS_RESTART': {
|
|
47
|
+
action: {
|
|
73
48
|
type: INVENTORY_PROCESS_RESTART,
|
|
74
|
-
payload: {
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
49
|
+
payload: {
|
|
50
|
+
accountID,
|
|
51
|
+
processStatusName,
|
|
52
|
+
},
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
|
|
57
|
+
describe('AccountList reducer', () =>
|
|
58
|
+
testReducerSnapshotWithFixtures(reducer, fixtures));
|
data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import {
|
|
3
|
+
selectAccountsList,
|
|
4
|
+
selectAccounts,
|
|
5
|
+
selectPollingProcessID,
|
|
6
|
+
} from '../AccountListSelectors';
|
|
7
|
+
import { pollingProcessID, accounts } from '../AccountList.fixtures';
|
|
8
|
+
import { rhCloudStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
|
|
9
|
+
|
|
10
|
+
const state = rhCloudStateWrapper({
|
|
11
|
+
accountsList: {
|
|
12
|
+
accounts,
|
|
13
|
+
pollingProcessID,
|
|
14
|
+
},
|
|
15
|
+
});
|
|
16
|
+
|
|
17
|
+
const fixtures = {
|
|
18
|
+
'should return AccountsList': () => selectAccountsList(state),
|
|
19
|
+
'should return AccountList accounts': () => selectAccounts(state),
|
|
20
|
+
'should return AccountList pollingProcessID': () =>
|
|
21
|
+
selectPollingProcessID(state),
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
describe('AccountList selectors', () =>
|
|
25
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AccountList rendering render with props 1`] = `
|
|
4
|
+
<Accordion
|
|
5
|
+
className="account-list"
|
|
6
|
+
>
|
|
7
|
+
<ListItem
|
|
8
|
+
account={
|
|
9
|
+
Object {
|
|
10
|
+
"generated_status": "running",
|
|
11
|
+
"id": 1,
|
|
12
|
+
"uploaded_status": "running",
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
defaultExpanded={true}
|
|
16
|
+
key="Account1"
|
|
17
|
+
label="Account1"
|
|
18
|
+
onTaskStart={[Function]}
|
|
19
|
+
/>
|
|
20
|
+
<ListItem
|
|
21
|
+
account={
|
|
22
|
+
Object {
|
|
23
|
+
"generated_status": "failure",
|
|
24
|
+
"id": 2,
|
|
25
|
+
"uploaded_status": "unknown",
|
|
26
|
+
}
|
|
27
|
+
}
|
|
28
|
+
defaultExpanded={false}
|
|
29
|
+
key="Account2"
|
|
30
|
+
label="Account2"
|
|
31
|
+
onTaskStart={[Function]}
|
|
32
|
+
/>
|
|
33
|
+
<ListItem
|
|
34
|
+
account={
|
|
35
|
+
Object {
|
|
36
|
+
"generated_status": "running",
|
|
37
|
+
"id": 3,
|
|
38
|
+
"uploaded_status": "success",
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
defaultExpanded={false}
|
|
42
|
+
key="Account3"
|
|
43
|
+
label="Account3"
|
|
44
|
+
onTaskStart={[Function]}
|
|
45
|
+
/>
|
|
46
|
+
</Accordion>
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`AccountList rendering show empty results 1`] = `<inventoryEmptyResults />`;
|
|
@@ -0,0 +1,86 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AccountList actions should fetchAccountsStatus 1`] = `
|
|
4
|
+
Array [
|
|
5
|
+
Array [
|
|
6
|
+
Object {
|
|
7
|
+
"payload": Object {
|
|
8
|
+
"CloudConnectorStatus": Object {
|
|
9
|
+
"id": 7,
|
|
10
|
+
"task": Object {
|
|
11
|
+
"id": 11,
|
|
12
|
+
},
|
|
13
|
+
},
|
|
14
|
+
"accounts": Object {
|
|
15
|
+
"Account1": Object {
|
|
16
|
+
"generated_status": "running",
|
|
17
|
+
"id": 1,
|
|
18
|
+
"uploaded_status": "running",
|
|
19
|
+
},
|
|
20
|
+
"Account2": Object {
|
|
21
|
+
"generated_status": "failure",
|
|
22
|
+
"id": 2,
|
|
23
|
+
"uploaded_status": "unknown",
|
|
24
|
+
},
|
|
25
|
+
"Account3": Object {
|
|
26
|
+
"generated_status": "running",
|
|
27
|
+
"id": 3,
|
|
28
|
+
"uploaded_status": "success",
|
|
29
|
+
},
|
|
30
|
+
},
|
|
31
|
+
},
|
|
32
|
+
"type": "INVENTORY_ACCOUNT_STATUS_POLLING",
|
|
33
|
+
},
|
|
34
|
+
],
|
|
35
|
+
]
|
|
36
|
+
`;
|
|
37
|
+
|
|
38
|
+
exports[`AccountList actions should invoke toast notification upon failure 1`] = `
|
|
39
|
+
Array [
|
|
40
|
+
Array [
|
|
41
|
+
Object {
|
|
42
|
+
"payload": Object {
|
|
43
|
+
"message": Object {
|
|
44
|
+
"message": "test error",
|
|
45
|
+
"sticky": true,
|
|
46
|
+
"type": "error",
|
|
47
|
+
},
|
|
48
|
+
},
|
|
49
|
+
"type": "TOASTS_ADD",
|
|
50
|
+
},
|
|
51
|
+
],
|
|
52
|
+
]
|
|
53
|
+
`;
|
|
54
|
+
|
|
55
|
+
exports[`AccountList actions should restartProcess 1`] = `
|
|
56
|
+
Array [
|
|
57
|
+
Array [
|
|
58
|
+
Object {
|
|
59
|
+
"payload": Object {
|
|
60
|
+
"accountID": "some-account-ID",
|
|
61
|
+
"processStatusName": "generated_status",
|
|
62
|
+
},
|
|
63
|
+
"type": "INVENTORY_PROCESS_RESTART",
|
|
64
|
+
},
|
|
65
|
+
],
|
|
66
|
+
]
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
exports[`AccountList actions should startAccountStatusPolling 1`] = `
|
|
70
|
+
Object {
|
|
71
|
+
"payload": Object {
|
|
72
|
+
"pollingProcessID": 0,
|
|
73
|
+
},
|
|
74
|
+
"type": "INVENTORY_ACCOUNT_STATUS_POLLING_START",
|
|
75
|
+
}
|
|
76
|
+
`;
|
|
77
|
+
|
|
78
|
+
exports[`AccountList actions should stopAccountStatusPolling 1`] = `
|
|
79
|
+
Array [
|
|
80
|
+
Array [
|
|
81
|
+
Object {
|
|
82
|
+
"type": "INVENTORY_ACCOUNT_STATUS_POLLING_STOP",
|
|
83
|
+
},
|
|
84
|
+
],
|
|
85
|
+
]
|
|
86
|
+
`;
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"CloudConnectorStatus": Object {
|
|
6
|
+
"id": 7,
|
|
7
|
+
"task": Object {
|
|
8
|
+
"id": 11,
|
|
9
|
+
},
|
|
10
|
+
},
|
|
11
|
+
"accounts": Object {
|
|
12
|
+
"Account1": Object {
|
|
13
|
+
"generated_status": "running",
|
|
14
|
+
"id": 1,
|
|
15
|
+
"uploaded_status": "running",
|
|
16
|
+
},
|
|
17
|
+
"Account2": Object {
|
|
18
|
+
"generated_status": "failure",
|
|
19
|
+
"id": 2,
|
|
20
|
+
"uploaded_status": "unknown",
|
|
21
|
+
},
|
|
22
|
+
"Account3": Object {
|
|
23
|
+
"generated_status": "running",
|
|
24
|
+
"id": 3,
|
|
25
|
+
"uploaded_status": "success",
|
|
26
|
+
},
|
|
27
|
+
},
|
|
28
|
+
"error": null,
|
|
29
|
+
"pollingProcessID": 0,
|
|
30
|
+
}
|
|
31
|
+
`;
|
|
32
|
+
|
|
33
|
+
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_ERROR 1`] = `
|
|
34
|
+
Object {
|
|
35
|
+
"accounts": Object {},
|
|
36
|
+
"error": "some-error",
|
|
37
|
+
"pollingProcessID": 0,
|
|
38
|
+
}
|
|
39
|
+
`;
|
|
40
|
+
|
|
41
|
+
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_START 1`] = `
|
|
42
|
+
Object {
|
|
43
|
+
"accounts": Object {},
|
|
44
|
+
"error": null,
|
|
45
|
+
"pollingProcessID": 0,
|
|
46
|
+
}
|
|
47
|
+
`;
|
|
48
|
+
|
|
49
|
+
exports[`AccountList reducer should handle INVENTORY_ACCOUNT_STATUS_POLLING_STOP 1`] = `
|
|
50
|
+
Object {
|
|
51
|
+
"accounts": Object {},
|
|
52
|
+
"error": null,
|
|
53
|
+
"pollingProcessID": 0,
|
|
54
|
+
}
|
|
55
|
+
`;
|
|
56
|
+
|
|
57
|
+
exports[`AccountList reducer should handle INVENTORY_PROCESS_RESTART 1`] = `
|
|
58
|
+
Object {
|
|
59
|
+
"accounts": Object {
|
|
60
|
+
"user@redhat.com": Object {
|
|
61
|
+
"upload_report_status": "Restarting...",
|
|
62
|
+
},
|
|
63
|
+
},
|
|
64
|
+
"error": null,
|
|
65
|
+
"pollingProcessID": 0,
|
|
66
|
+
}
|
|
67
|
+
`;
|
|
68
|
+
|
|
69
|
+
exports[`AccountList reducer should return the initial state 1`] = `
|
|
70
|
+
Object {
|
|
71
|
+
"accounts": Object {},
|
|
72
|
+
"error": null,
|
|
73
|
+
"pollingProcessID": 0,
|
|
74
|
+
}
|
|
75
|
+
`;
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AccountList selectors should return AccountList accounts 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"Account1": Object {
|
|
6
|
+
"generated_status": "running",
|
|
7
|
+
"id": 1,
|
|
8
|
+
"uploaded_status": "running",
|
|
9
|
+
},
|
|
10
|
+
"Account2": Object {
|
|
11
|
+
"generated_status": "failure",
|
|
12
|
+
"id": 2,
|
|
13
|
+
"uploaded_status": "unknown",
|
|
14
|
+
},
|
|
15
|
+
"Account3": Object {
|
|
16
|
+
"generated_status": "running",
|
|
17
|
+
"id": 3,
|
|
18
|
+
"uploaded_status": "success",
|
|
19
|
+
},
|
|
20
|
+
}
|
|
21
|
+
`;
|
|
22
|
+
|
|
23
|
+
exports[`AccountList selectors should return AccountList pollingProcessID 1`] = `0`;
|
|
24
|
+
|
|
25
|
+
exports[`AccountList selectors should return AccountsList 1`] = `
|
|
26
|
+
Object {
|
|
27
|
+
"accounts": Object {
|
|
28
|
+
"Account1": Object {
|
|
29
|
+
"generated_status": "running",
|
|
30
|
+
"id": 1,
|
|
31
|
+
"uploaded_status": "running",
|
|
32
|
+
},
|
|
33
|
+
"Account2": Object {
|
|
34
|
+
"generated_status": "failure",
|
|
35
|
+
"id": 2,
|
|
36
|
+
"uploaded_status": "unknown",
|
|
37
|
+
},
|
|
38
|
+
"Account3": Object {
|
|
39
|
+
"generated_status": "running",
|
|
40
|
+
"id": 3,
|
|
41
|
+
"uploaded_status": "success",
|
|
42
|
+
},
|
|
43
|
+
},
|
|
44
|
+
"pollingProcessID": 0,
|
|
45
|
+
}
|
|
46
|
+
`;
|
|
@@ -1,17 +1,13 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
|
|
3
3
|
import FileDownload from '../FileDownload';
|
|
4
4
|
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
});
|
|
5
|
+
const fixtures = {
|
|
6
|
+
'render without Props': {},
|
|
7
|
+
/** fixtures, props for the component */
|
|
8
|
+
};
|
|
10
9
|
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
fireEvent.click(screen.getByRole('button', { name: /Download Report/ }));
|
|
15
|
-
expect(onClick).toHaveBeenCalledTimes(1);
|
|
16
|
-
});
|
|
10
|
+
describe('FileDownload', () => {
|
|
11
|
+
describe('rendering', () =>
|
|
12
|
+
testComponentSnapshotsWithFixtures(FileDownload, fixtures));
|
|
17
13
|
});
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`FileDownload rendering render without Props 1`] = `
|
|
4
|
+
<Col
|
|
5
|
+
bsClass="col"
|
|
6
|
+
componentClass="div"
|
|
7
|
+
sm={12}
|
|
8
|
+
>
|
|
9
|
+
<Button
|
|
10
|
+
active={false}
|
|
11
|
+
block={false}
|
|
12
|
+
bsClass="btn"
|
|
13
|
+
bsStyle="default"
|
|
14
|
+
className="download-button"
|
|
15
|
+
disabled={false}
|
|
16
|
+
onClick={[Function]}
|
|
17
|
+
>
|
|
18
|
+
Download Report
|
|
19
|
+
|
|
20
|
+
<Icon
|
|
21
|
+
name="download"
|
|
22
|
+
type="fa"
|
|
23
|
+
/>
|
|
24
|
+
</Button>
|
|
25
|
+
</Col>
|
|
26
|
+
`;
|
data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js
CHANGED
|
@@ -1,17 +1,20 @@
|
|
|
1
|
-
import
|
|
2
|
-
import {
|
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { noop } from 'foremanReact/common/helpers';
|
|
3
|
+
|
|
3
4
|
import InventoryFilter from '../InventoryFilter';
|
|
5
|
+
import { filterTerm, organization } from '../InventoryFilter.fixtures';
|
|
4
6
|
|
|
5
|
-
|
|
7
|
+
const fixtures = {
|
|
8
|
+
'render with props': {
|
|
9
|
+
handleFilterChange: noop,
|
|
10
|
+
handleFilterClear: noop,
|
|
11
|
+
filterTerm,
|
|
12
|
+
organization,
|
|
13
|
+
},
|
|
14
|
+
/** fixtures, props for the component */
|
|
15
|
+
};
|
|
6
16
|
|
|
7
17
|
describe('InventoryFilter', () => {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
expect(screen.getByPlaceholderText('Filter..')).toBeTruthy();
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
it('displays the current filter term', () => {
|
|
14
|
-
render(<InventoryFilter filterTerm="test-filter" />);
|
|
15
|
-
expect(screen.getByDisplayValue('test-filter')).toBeTruthy();
|
|
16
|
-
});
|
|
18
|
+
describe('rendering', () =>
|
|
19
|
+
testComponentSnapshotsWithFixtures(InventoryFilter, fixtures));
|
|
17
20
|
});
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { testActionSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import {
|
|
3
|
+
handleFilterChange,
|
|
4
|
+
handleFilterClear,
|
|
5
|
+
} from '../InventoryFilterActions';
|
|
6
|
+
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
7
|
+
|
|
8
|
+
const fixtures = {
|
|
9
|
+
'should handleFilterChange': () => handleFilterChange(filterTerm),
|
|
10
|
+
'should handleFilterClear': () => handleFilterClear(),
|
|
11
|
+
};
|
|
12
|
+
|
|
13
|
+
describe('InventoryFilter actions', () =>
|
|
14
|
+
testActionSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { testReducerSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import reducer from '../InventoryFilterReducer';
|
|
3
|
+
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
4
|
+
import {
|
|
5
|
+
INVENTORY_FILTER_UPDATE,
|
|
6
|
+
INVENTORY_FILTER_CLEAR,
|
|
7
|
+
} from '../InventoryFilterConstants';
|
|
8
|
+
|
|
9
|
+
const fixtures = {
|
|
10
|
+
'should return the initial state': {},
|
|
11
|
+
'should handle INVENTORY_FILTER_UPDATE': {
|
|
12
|
+
action: {
|
|
13
|
+
type: INVENTORY_FILTER_UPDATE,
|
|
14
|
+
payload: {
|
|
15
|
+
filterTerm,
|
|
16
|
+
},
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
'should handle INVENTORY_FILTER_CLEAR': {
|
|
20
|
+
action: {
|
|
21
|
+
type: INVENTORY_FILTER_CLEAR,
|
|
22
|
+
payload: {},
|
|
23
|
+
},
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
describe('AccountList reducer', () =>
|
|
28
|
+
testReducerSnapshotWithFixtures(reducer, fixtures));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
|
2
|
+
import { filterTerm } from '../InventoryFilter.fixtures';
|
|
3
|
+
import { rhCloudStateWrapper } from '../../../../ForemanRhCloudTestHelpers';
|
|
4
|
+
import {
|
|
5
|
+
selectInventoryFilter,
|
|
6
|
+
selectFilterTerm,
|
|
7
|
+
} from '../InventoryFilterSelectors';
|
|
8
|
+
|
|
9
|
+
const state = rhCloudStateWrapper({
|
|
10
|
+
inventoryFilter: {
|
|
11
|
+
filterTerm,
|
|
12
|
+
},
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
const fixtures = {
|
|
16
|
+
'should return InventoryFilter': () => selectInventoryFilter(state),
|
|
17
|
+
'should return filterTerm': () => selectFilterTerm(state),
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
describe('InventoryFilter selectors', () =>
|
|
21
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InventoryFilter rendering render with props 1`] = `
|
|
4
|
+
<form
|
|
5
|
+
id="inventory_filter_form"
|
|
6
|
+
>
|
|
7
|
+
<FormGroup>
|
|
8
|
+
<TextInput
|
|
9
|
+
id="inventory_filter_input"
|
|
10
|
+
onChange={[Function]}
|
|
11
|
+
ouiaId="inventory_filter_input"
|
|
12
|
+
placeholder="Filter.."
|
|
13
|
+
type="text"
|
|
14
|
+
value="test_filter_term"
|
|
15
|
+
/>
|
|
16
|
+
<ClearButton
|
|
17
|
+
onClear={[Function]}
|
|
18
|
+
/>
|
|
19
|
+
</FormGroup>
|
|
20
|
+
</form>
|
|
21
|
+
`;
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InventoryFilter actions should handleFilterChange 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"payload": Object {
|
|
6
|
+
"filterTerm": "test_filter_term",
|
|
7
|
+
},
|
|
8
|
+
"type": "INVENTORY_FILTER_UPDATE",
|
|
9
|
+
}
|
|
10
|
+
`;
|
|
11
|
+
|
|
12
|
+
exports[`InventoryFilter actions should handleFilterClear 1`] = `
|
|
13
|
+
Object {
|
|
14
|
+
"payload": Object {},
|
|
15
|
+
"type": "INVENTORY_FILTER_CLEAR",
|
|
16
|
+
}
|
|
17
|
+
`;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`AccountList reducer should handle INVENTORY_FILTER_CLEAR 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"filterTerm": "",
|
|
6
|
+
}
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
exports[`AccountList reducer should handle INVENTORY_FILTER_UPDATE 1`] = `
|
|
10
|
+
Object {
|
|
11
|
+
"filterTerm": "test_filter_term",
|
|
12
|
+
}
|
|
13
|
+
`;
|
|
14
|
+
|
|
15
|
+
exports[`AccountList reducer should return the initial state 1`] = `
|
|
16
|
+
Object {
|
|
17
|
+
"filterTerm": "",
|
|
18
|
+
}
|
|
19
|
+
`;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InventoryFilter selectors should return InventoryFilter 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"filterTerm": "test_filter_term",
|
|
6
|
+
}
|
|
7
|
+
`;
|
|
8
|
+
|
|
9
|
+
exports[`InventoryFilter selectors should return filterTerm 1`] = `"test_filter_term"`;
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
// Jest Snapshot v1, https://goo.gl/fbAQLP
|
|
2
|
+
|
|
3
|
+
exports[`InventoryFilter integration test should flow: filter have been updated 1`] = `
|
|
4
|
+
Object {
|
|
5
|
+
"action": Array [
|
|
6
|
+
Array [
|
|
7
|
+
Object {
|
|
8
|
+
"payload": Object {
|
|
9
|
+
"filterTerm": "some-org",
|
|
10
|
+
},
|
|
11
|
+
"type": "INVENTORY_FILTER_UPDATE",
|
|
12
|
+
},
|
|
13
|
+
],
|
|
14
|
+
],
|
|
15
|
+
"state": Object {
|
|
16
|
+
"ForemanRhCloud": Object {
|
|
17
|
+
"InsightsCloudSync": Object {
|
|
18
|
+
"settings": Object {
|
|
19
|
+
"insightsSyncEnabled": false,
|
|
20
|
+
},
|
|
21
|
+
"table": Object {
|
|
22
|
+
"isAllSelected": false,
|
|
23
|
+
"selectedIds": Object {},
|
|
24
|
+
"showSelectAllAlert": false,
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
"hostInsights": Object {
|
|
28
|
+
"hits": Array [],
|
|
29
|
+
},
|
|
30
|
+
"inventoryUpload": Object {
|
|
31
|
+
"accountsList": Object {
|
|
32
|
+
"accounts": Object {},
|
|
33
|
+
"error": null,
|
|
34
|
+
"pollingProcessID": 0,
|
|
35
|
+
},
|
|
36
|
+
"inventoryFilter": Object {
|
|
37
|
+
"filterTerm": "some-org",
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
},
|
|
41
|
+
},
|
|
42
|
+
}
|
|
43
|
+
`;
|