foreman_rh_cloud 1.0.6 → 2.0.5

Sign up to get free protection for your applications and to get access to all the features.
Files changed (59) hide show
  1. checksums.yaml +4 -4
  2. data/lib/foreman_inventory_upload/async/shell_process.rb +1 -3
  3. data/lib/foreman_inventory_upload/async/upload_report_job.rb +1 -5
  4. data/lib/foreman_inventory_upload/generators/fact_helpers.rb +0 -13
  5. data/lib/foreman_inventory_upload/generators/queries.rb +0 -1
  6. data/lib/foreman_inventory_upload/generators/slice.rb +8 -12
  7. data/lib/foreman_rh_cloud/engine.rb +1 -1
  8. data/lib/foreman_rh_cloud/version.rb +1 -1
  9. data/package.json +20 -100
  10. data/test/factories/inventory_upload_factories.rb +13 -13
  11. data/test/unit/archived_report_generator_test.rb +0 -1
  12. data/test/unit/slice_generator_test.rb +20 -74
  13. data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +5 -14
  14. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -1
  15. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +1 -1
  16. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +1 -1
  17. data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +1 -1
  18. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +1 -1
  19. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +1 -1
  20. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +1 -1
  21. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +1 -1
  22. data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +1 -1
  23. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +1 -1
  24. data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +1 -1
  25. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +13 -9
  26. data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +5 -15
  27. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +1 -2
  28. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +15 -2
  29. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +1 -1
  30. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +1 -1
  31. data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +1 -1
  32. data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +1 -1
  33. data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +1 -1
  34. data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +5 -2
  35. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +1 -2
  36. data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +1 -1
  37. data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +1 -1
  38. data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +1 -1
  39. data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +1 -1
  40. data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +1 -1
  41. data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +1 -1
  42. data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +1 -1
  43. data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +1 -1
  44. data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +1 -1
  45. data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +1 -1
  46. data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
  47. data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -2
  48. data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.test.js +1 -1
  49. metadata +2 -14
  50. data/lib/foreman_inventory_upload/async/async_helpers.rb +0 -13
  51. data/test/unit/fact_helpers_test.rb +0 -29
  52. data/test/unit/slice_generator_test.rb.orig +0 -280
  53. data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
  54. data/webpack/stories/configureStore.js +0 -15
  55. data/webpack/stories/decorators/index.js +0 -1
  56. data/webpack/stories/decorators/withCardsDecorator.js +0 -14
  57. data/webpack/stories/index.js +0 -10
  58. data/webpack/stories/index.scss +0 -7
  59. data/webpack/test_setup.js +0 -6
@@ -1,18 +1,9 @@
1
1
  import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { withKnobs } from '@storybook/addon-knobs';
4
- import { Provider } from 'react-redux';
5
- import configureStore from '../../../stories/configureStore';
6
2
  import AccountList from './AccountList';
7
3
 
8
- const store = configureStore();
4
+ export default {
5
+ title: 'AccountList',
6
+ component: AccountList,
7
+ };
9
8
 
10
- storiesOf('Account list', module)
11
- .addDecorator(withKnobs)
12
- .add('Account list', () => (
13
- <div style={{ margin: '20px' }}>
14
- <Provider store={store}>
15
- <AccountList />
16
- </Provider>
17
- </div>
18
- ));
9
+ export const Basic = () => <AccountList />;
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import EmptyState from '../EmptyState';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ErrorState from '../ErrorState';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ListItem from '../ListItem';
4
4
  import { props } from '../ListItem.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ListItemStatus from '../ListItemStatus';
4
4
  import { props } from '../ListItemStatus.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import AccountList from '../AccountList';
4
4
  import { props } from '../AccountList.fixtures';
@@ -1,4 +1,4 @@
1
- import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testActionSnapshotWithFixtures } from '@theforeman/test';
2
2
  import {
3
3
  fetchAccountsStatus,
4
4
  startAccountStatusPolling,
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IntegrationTestHelper } from 'react-redux-test-utils';
2
+ import { IntegrationTestHelper } from '@theforeman/test';
3
3
 
4
4
  import AccountList from '../index';
5
5
  import reducers from '../../../ForemanInventoryUploadReducers';
@@ -1,4 +1,4 @@
1
- import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testReducerSnapshotWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import {
4
4
  INVENTORY_ACCOUNT_STATUS_POLLING,
@@ -1,4 +1,4 @@
1
- import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
2
2
  import {
3
3
  selectAccountsList,
4
4
  selectAccounts,
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
  import { noop } from 'patternfly-react';
3
3
 
4
4
  import AutoUploadSwitcher from '../AutoUploadSwitcher';
@@ -1,4 +1,4 @@
1
- import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testActionSnapshotWithFixtures } from '@theforeman/test';
2
2
  import API from 'foremanReact/API';
3
3
  import { handleToggle } from '../AutoUploadSwitcherActions';
4
4
  import { handleToggleResponse } from '../AutoUploadSwitcher.fixtures';
@@ -8,16 +8,20 @@ export const completed = 25;
8
8
 
9
9
  export const error = 'some-error';
10
10
 
11
+ export const generating = {
12
+ logs,
13
+ completed,
14
+ };
15
+
16
+ export const uploading = {
17
+ logs,
18
+ completed,
19
+ files,
20
+ };
21
+
11
22
  export const inventory = {
12
- generating: {
13
- logs,
14
- completed,
15
- },
16
- uploading: {
17
- logs,
18
- completed,
19
- files,
20
- },
23
+ generating,
24
+ uploading,
21
25
  };
22
26
 
23
27
  export const accountID = 'some-account-ID';
@@ -1,19 +1,9 @@
1
1
  import React from 'react';
2
- import { storiesOf } from '@storybook/react';
3
- import { withKnobs } from '@storybook/addon-knobs';
4
- import { Provider } from 'react-redux';
5
- import configureStore from '../../../stories/configureStore';
6
2
  import Dashboard from './index';
7
- import { generating, uploading } from './Dashboard.fixtures';
8
3
 
9
- const store = configureStore();
4
+ export default {
5
+ title: 'Dashboard',
6
+ component: Dashboard,
7
+ };
10
8
 
11
- storiesOf('Dashboard', module)
12
- .addDecorator(withKnobs)
13
- .add('Dashboard', () => (
14
- <div style={{ margin: '20px' }}>
15
- <Provider store={store}>
16
- <Dashboard generating={generating} uploading={uploading} />
17
- </Provider>
18
- </div>
19
- ));
9
+ export const Basic = () => <Dashboard />;
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { shallow } from 'enzyme';
3
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
+ import { shallow, testComponentSnapshotsWithFixtures } from '@theforeman/test';
4
3
  import Dashboard from '../Dashboard';
5
4
  import { props } from '../Dashboard.fixtures';
6
5
 
@@ -1,4 +1,4 @@
1
- import { testActionSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testActionSnapshotWithFixtures } from '@theforeman/test';
2
2
  import API from 'foremanReact/API';
3
3
  import {
4
4
  startPolling,
@@ -36,4 +36,17 @@ const fixtures = {
36
36
  runWithGetState({ activeTab: 'reports' }, toggleFullScreen, accountID),
37
37
  };
38
38
 
39
- describe('Dashboard actions', () => testActionSnapshotWithFixtures(fixtures));
39
+ describe('Dashboard actions', () => {
40
+ const { location } = window;
41
+
42
+ beforeAll(() => {
43
+ delete window.location;
44
+ window.location = { href: jest.fn() };
45
+ });
46
+
47
+ afterAll(() => {
48
+ window.location = location;
49
+ });
50
+
51
+ return testActionSnapshotWithFixtures(fixtures);
52
+ });
@@ -1,5 +1,5 @@
1
1
  import React from 'react';
2
- import { IntegrationTestHelper } from 'react-redux-test-utils';
2
+ import { IntegrationTestHelper } from '@theforeman/test';
3
3
 
4
4
  import Dashboard from '../Dashboard';
5
5
  import reducers from '../../../ForemanInventoryUploadReducers';
@@ -1,4 +1,4 @@
1
- import { testReducerSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testReducerSnapshotWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import {
4
4
  INVENTORY_POLLING_START,
@@ -1,4 +1,4 @@
1
- import { testSelectorsSnapshotWithFixtures } from 'react-redux-test-utils';
1
+ import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
2
2
  import {
3
3
  selectDashboard,
4
4
  selectPollingProcessID,
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import FileDownload from '../FileDownload';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import FullScreenModal from '../FullScreenModal';
4
4
 
@@ -1,10 +1,13 @@
1
+ import React from 'react';
2
+ import { noop } from 'patternfly-react';
3
+
1
4
  export const props = {
2
5
  items: [
3
6
  {
4
7
  icon: 'some-icon',
5
8
  name: 'some-name',
6
- component: jest.fn,
7
- onClick: jest.fn,
9
+ component: () => <p>test</p>,
10
+ onClick: noop,
8
11
  },
9
12
  ],
10
13
  };
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { mount } from 'enzyme';
3
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
2
+ import { mount, testComponentSnapshotsWithFixtures } from '@theforeman/test';
4
3
  import NavContainer from '../NavContainer';
5
4
  import { props } from '../NavContainer.fixtures';
6
5
 
@@ -45,7 +45,7 @@ exports[`NavContainer rendering render with Props 1`] = `
45
45
  eventKey={0}
46
46
  key="0"
47
47
  >
48
- <bound fn />
48
+ <component />
49
49
  </TabPane>
50
50
  </TabContent>
51
51
  <FullScreenModal
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import PageHeader from '../PageHeader';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ReportGenerate from '../ReportGenerate';
4
4
  import { props } from '../ReportGenerate.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ReportUpload from '../ReportUpload';
4
4
  import { props } from '../ReportUpload.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ScheduledRun from '../ScheduledRun';
4
4
  import { props } from '../ScheduledRun.fixtures';
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import StatusChart from '../StatusChart';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabBody from '../TabBody';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabContainer from '../TabContainer';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabFooter from '../TabFooter';
4
4
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import TabHeader from '../TabHeader';
4
4
 
@@ -1,7 +1,7 @@
1
1
  import React from 'react';
2
2
  import PropTypes from 'prop-types';
3
3
  import { Grid, Spinner } from 'patternfly-react';
4
- import isEqual from 'lodash/isEqual';
4
+ import { isEqual } from 'lodash';
5
5
  import './terminal.scss';
6
6
  import { isTerminalScrolledDown } from './TerminalHelper';
7
7
 
@@ -1,6 +1,5 @@
1
1
  import React from 'react';
2
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
3
- import { mount } from 'enzyme';
2
+ import { mount, testComponentSnapshotsWithFixtures } from '@theforeman/test';
4
3
  import Terminal from '../Terminal';
5
4
  import { props, logs } from '../Terminal.fixtures';
6
5
 
@@ -1,4 +1,4 @@
1
- import { testComponentSnapshotsWithFixtures } from 'react-redux-test-utils';
1
+ import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
2
2
 
3
3
  import ForemanInventoryUpload from './ForemanInventoryUpload';
4
4
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: foreman_rh_cloud
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.6
4
+ version: 2.0.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Foreman Red Hat Cloud team
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-22 00:00:00.000000000 Z
11
+ date: 2020-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: katello
@@ -113,7 +113,6 @@ files:
113
113
  - app/views/foreman_inventory_upload/layouts/react.html.erb
114
114
  - config/routes.rb
115
115
  - lib/foreman_inventory_upload.rb
116
- - lib/foreman_inventory_upload/async/async_helpers.rb
117
116
  - lib/foreman_inventory_upload/async/generate_all_reports_job.rb
118
117
  - lib/foreman_inventory_upload/async/generate_report_job.rb
119
118
  - lib/foreman_inventory_upload/async/progress_output.rb
@@ -143,11 +142,9 @@ files:
143
142
  - test/factories/inventory_upload_factories.rb
144
143
  - test/test_plugin_helper.rb
145
144
  - test/unit/archived_report_generator_test.rb
146
- - test/unit/fact_helpers_test.rb
147
145
  - test/unit/metadata_generator_test.rb
148
146
  - test/unit/shell_process_job_test.rb
149
147
  - test/unit/slice_generator_test.rb
150
- - test/unit/slice_generator_test.rb.orig
151
148
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js
152
149
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js
153
150
  - webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js
@@ -322,13 +319,6 @@ files:
322
319
  - webpack/__mocks__/foremanReact/common/I18n.js
323
320
  - webpack/__mocks__/foremanReact/common/helpers.js
324
321
  - webpack/index.js
325
- - webpack/stories/ForemanInventoryUploadReducers.js
326
- - webpack/stories/configureStore.js
327
- - webpack/stories/decorators/index.js
328
- - webpack/stories/decorators/withCardsDecorator.js
329
- - webpack/stories/index.js
330
- - webpack/stories/index.scss
331
- - webpack/test_setup.js
332
322
  homepage: https://github.com/theforeman/foreman_rh_cloud
333
323
  licenses:
334
324
  - GPL-3.0
@@ -360,7 +350,5 @@ test_files:
360
350
  - test/factories/inventory_upload_factories.rb
361
351
  - test/unit/shell_process_job_test.rb
362
352
  - test/unit/metadata_generator_test.rb
363
- - test/unit/slice_generator_test.rb.orig
364
- - test/unit/fact_helpers_test.rb
365
353
  - test/unit/archived_report_generator_test.rb
366
354
  - test/unit/slice_generator_test.rb
@@ -1,13 +0,0 @@
1
- module ForemanInventoryUpload
2
- module Async
3
- module AsyncHelpers
4
- extend ActiveSupport::Concern
5
-
6
- def hash_to_s(hash)
7
- hash.each_with_object({}) do |(k, v), a|
8
- a[k.to_s] = v.to_s
9
- end
10
- end
11
- end
12
- end
13
- end
@@ -1,29 +0,0 @@
1
- require 'test_plugin_helper'
2
-
3
- class FactHelpersTest < ActiveSupport::TestCase
4
- class FactsHelpersTestStub
5
- include ForemanInventoryUpload::Generators::FactHelpers
6
- end
7
-
8
- setup do
9
- @instance = FactsHelpersTestStub.new
10
-
11
- @org = FactoryBot.create(:organization)
12
- end
13
-
14
- test 'golden_ticket uses golden_ticket method when defined' do
15
- @org.expects(:golden_ticket?).returns(true)
16
-
17
- actual = @instance.golden_ticket?(@org)
18
-
19
- assert actual
20
- end
21
-
22
- test 'golden_ticket uses content_access_mode method when golden_ticket not defined' do
23
- @org.expects(:content_access_mode).returns('org_environment')
24
-
25
- actual = @instance.golden_ticket?(@org)
26
-
27
- assert actual
28
- end
29
- end