katello 3.7.0.rc1 → 3.7.0.rc2

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of katello might be problematic. Click here for more details.

Files changed (189) hide show
  1. checksums.yaml +4 -4
  2. data/app/controllers/katello/api/v2/content_views_controller.rb +5 -2
  3. data/app/controllers/katello/api/v2/environments_controller.rb +8 -3
  4. data/app/controllers/katello/api/v2/host_tracer_controller.rb +1 -1
  5. data/app/controllers/katello/api/v2/upstream_subscriptions_controller.rb +4 -4
  6. data/app/helpers/katello/hosts_and_hostgroups_helper.rb +5 -22
  7. data/app/lib/actions/katello/host/update_content_overrides.rb +1 -0
  8. data/app/lib/actions/katello/product/content_create.rb +1 -0
  9. data/app/lib/actions/katello/product/repositories_certs_reset.rb +25 -0
  10. data/app/lib/actions/katello/product/update.rb +6 -0
  11. data/app/lib/katello/resources/candlepin/activation_key.rb +8 -4
  12. data/app/lib/katello/resources/candlepin/product.rb +2 -1
  13. data/app/lib/katello/util/cdn_var_substitutor.rb +5 -3
  14. data/app/lib/katello/util/package.rb +21 -13
  15. data/app/lib/katello/util/package_filter.rb +33 -31
  16. data/app/lib/katello/validators/prior_validator.rb +6 -10
  17. data/app/models/katello/concerns/host_managed_extensions.rb +2 -0
  18. data/app/models/katello/concerns/organization_extensions.rb +1 -0
  19. data/app/models/katello/concerns/subscription_facet_host_extensions.rb +10 -6
  20. data/app/models/katello/content.rb +23 -2
  21. data/app/models/katello/content_view_docker_filter.rb +1 -1
  22. data/app/models/katello/content_view_puppet_module.rb +3 -3
  23. data/app/models/katello/content_view_version.rb +4 -0
  24. data/app/models/katello/environment_prior.rb +7 -0
  25. data/app/models/katello/glue/candlepin/candlepin_object.rb +2 -2
  26. data/app/models/katello/glue/candlepin/pool.rb +10 -13
  27. data/app/models/katello/glue/candlepin/product.rb +19 -9
  28. data/app/models/katello/glue/candlepin/repository.rb +16 -0
  29. data/app/models/katello/glue/candlepin/subscription.rb +1 -1
  30. data/app/models/katello/glue/provider.rb +15 -81
  31. data/app/models/katello/host/subscription_facet.rb +1 -1
  32. data/app/models/katello/kt_environment.rb +39 -8
  33. data/app/models/katello/pool.rb +2 -1
  34. data/app/models/katello/rpm.rb +144 -2
  35. data/app/models/katello/upstream_pool.rb +7 -10
  36. data/app/services/katello/candlepin/pool_service.rb +18 -3
  37. data/app/services/katello/ui_notifications/pulp/proxy_disk_space.rb +13 -16
  38. data/app/views/dashboard/_content_views_widget.html.erb +3 -3
  39. data/app/views/dashboard/_errata_widget.html.erb +2 -2
  40. data/app/views/dashboard/_host_collection_widget.html.erb +3 -3
  41. data/app/views/dashboard/_subscription_status_widget.html.erb +2 -2
  42. data/app/views/dashboard/_subscription_widget.html.erb +1 -1
  43. data/app/views/dashboard/_sync_widget.html.erb +3 -3
  44. data/app/views/katello/api/v2/subscriptions/base.json.rabl +1 -1
  45. data/app/views/katello/api/v2/upstream_subscriptions/base.json.rabl +2 -6
  46. data/app/views/katello/layouts/react.html.erb +3 -3
  47. data/config/katello.yaml +89 -0
  48. data/config/routes.rb +3 -0
  49. data/db/migrate/20160302091113_change_environment_prior.rb +9 -0
  50. data/db/migrate/20180410140909_add_organization_id_to_pool.rb +2 -1
  51. data/db/migrate/20180612163403_add_foreign_key_to_hypervisor_id.rb +10 -0
  52. data/db/migrate/20180612164926_add_content_org_id.rb +39 -0
  53. data/db/migrate/20180612165011_remove_content_fields_from_host.rb +7 -0
  54. data/db/migrate/20180626160422_add_upstream_pool_id_to_katello_pool.rb +9 -0
  55. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/bulk/views/content-hosts-bulk-packages-modal.html +1 -1
  56. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/content-hosts/views/register.html +1 -1
  57. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/environment-content.controller.js +2 -3
  58. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/details/views/environment.html +4 -2
  59. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/environments.controller.js +19 -14
  60. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/new-environment.controller.js +18 -5
  61. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/paths.service.js +51 -0
  62. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/environments/views/new-environment.html +16 -3
  63. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/bulk/products-bulk-advanced-sync-modal.controller.js +1 -1
  64. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/products/products.controller.js +2 -2
  65. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/subscriptions/subscriptions.routes.js +3 -3
  66. data/engines/bastion_katello/app/assets/javascripts/bastion_katello/tasks/tasks.module.js +1 -6
  67. data/engines/bastion_katello/app/assets/stylesheets/bastion_katello/bastion_katello.scss +4 -0
  68. data/engines/bastion_katello/lib/bastion_katello/engine.rb +1 -1
  69. data/lib/katello/plugin.rb +2 -11
  70. data/lib/katello/scheduled_jobs.rb +2 -14
  71. data/lib/katello/tasks/clean_backend_objects.rake +2 -0
  72. data/lib/katello/tasks/repository.rake +11 -2
  73. data/lib/katello/tasks/upgrades/3.7/import_pools.rake +12 -0
  74. data/lib/katello/version.rb +1 -1
  75. data/package.json +4 -3
  76. data/webpack/components/PaginationRow/index.js +6 -2
  77. data/webpack/containers/Application/config.js +7 -2
  78. data/webpack/index.js +3 -5
  79. data/webpack/move_to_foreman/common/helpers.js +5 -24
  80. data/webpack/move_to_foreman/components/common/emptyState/index.js +12 -7
  81. data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.js +31 -0
  82. data/webpack/move_to_foreman/components/common/table/components/CollapseSubscriptionGroupButton.test.js +16 -0
  83. data/webpack/move_to_foreman/components/common/table/components/Table.js +76 -0
  84. data/webpack/move_to_foreman/components/common/table/components/Table.test.js +31 -0
  85. data/webpack/move_to_foreman/components/common/table/components/TableBody.js +27 -0
  86. data/webpack/move_to_foreman/components/common/table/components/TableBody.test.js +18 -0
  87. data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.js +18 -0
  88. data/webpack/move_to_foreman/components/common/table/components/TableBodyMessage.test.js +12 -0
  89. data/webpack/move_to_foreman/components/common/table/components/TableFixtures.js +14 -0
  90. data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.js +39 -0
  91. data/webpack/move_to_foreman/components/common/table/components/TableSelectionCell.test.js +16 -0
  92. data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.js +34 -0
  93. data/webpack/move_to_foreman/components/common/table/components/TableSelectionHeaderCell.test.js +14 -0
  94. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/CollapseSubscriptionGroupButton.test.js.snap +19 -0
  95. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/Table.test.js.snap +167 -0
  96. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBody.test.js.snap +28 -0
  97. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableBodyMessage.test.js.snap +13 -0
  98. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionCell.test.js.snap +16 -0
  99. data/webpack/move_to_foreman/components/common/table/components/__snapshots__/TableSelectionHeaderCell.test.js.snap +15 -0
  100. data/webpack/move_to_foreman/components/common/table/components/index.js +6 -0
  101. data/webpack/move_to_foreman/components/common/table/formatters/cellFormatter.js +4 -0
  102. data/webpack/move_to_foreman/components/common/table/formatters/collapseableAndSelectionCellFormatter.js +18 -0
  103. data/webpack/move_to_foreman/components/common/table/formatters/ellipsisCellFormatter.js +5 -0
  104. data/webpack/move_to_foreman/components/common/table/formatters/headerFormatter.js +4 -0
  105. data/webpack/move_to_foreman/components/common/table/formatters/index.js +6 -0
  106. data/webpack/move_to_foreman/components/common/table/formatters/selectionCellFormatter.js +17 -0
  107. data/webpack/move_to_foreman/components/common/table/formatters/selectionHeaderCellFormatter.js +10 -0
  108. data/webpack/move_to_foreman/components/common/table/index.js +2 -88
  109. data/webpack/move_to_pf/LoadingState/LoadingState.js +35 -0
  110. data/webpack/move_to_pf/LoadingState/LoadingState.scss +12 -0
  111. data/webpack/move_to_pf/LoadingState/LoadingState.test.js +28 -0
  112. data/webpack/move_to_pf/LoadingState/__snapshots__/LoadingState.test.js.snap +20 -0
  113. data/webpack/move_to_pf/LoadingState/index.js +3 -0
  114. data/webpack/move_to_pf/test-utils/testHelpers.js +71 -0
  115. data/webpack/redux/actions/RedHatRepositories/enabled.js +1 -1
  116. data/webpack/redux/actions/RedHatRepositories/helpers.js +34 -9
  117. data/webpack/redux/actions/RedHatRepositories/sets.js +28 -6
  118. data/webpack/redux/consts.js +1 -0
  119. data/webpack/redux/reducers/RedHatRepositories/sets.fixtures.js +12 -2
  120. data/webpack/redux/reducers/RedHatRepositories/sets.js +34 -27
  121. data/webpack/redux/reducers/RedHatRepositories/sets.test.js +10 -2
  122. data/webpack/redux/reducers/index.js +2 -0
  123. data/webpack/scenes/Organizations/OrganizationActions.js +3 -3
  124. data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.js +44 -0
  125. data/webpack/scenes/RedHatRepositories/components/RecommendedRepositorySetsToggler.scss +16 -0
  126. data/webpack/scenes/RedHatRepositories/components/RepositorySet.js +8 -2
  127. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepositories.js +5 -3
  128. data/webpack/scenes/RedHatRepositories/components/RepositorySetRepository.js +4 -2
  129. data/webpack/scenes/RedHatRepositories/components/Search.js +1 -1
  130. data/webpack/scenes/RedHatRepositories/components/SearchBar.js +1 -1
  131. data/webpack/scenes/RedHatRepositories/components/__tests__/RecommendedRepositorySetsToggler.test.js +17 -0
  132. data/webpack/scenes/RedHatRepositories/components/__tests__/__snapshots__/RecommendedRepositorySetsToggler.test.js.snap +37 -0
  133. data/webpack/scenes/RedHatRepositories/helpers.js +1 -1
  134. data/webpack/scenes/RedHatRepositories/index.js +17 -7
  135. data/webpack/scenes/RedHatRepositories/index.scss +16 -4
  136. data/webpack/scenes/Subscriptions/Details/SubscriptionAttributes.js +17 -0
  137. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailActions.js +28 -0
  138. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailAssociations.js +47 -0
  139. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailConstants.js +3 -0
  140. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailInfo.js +65 -0
  141. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailProducts.js +20 -0
  142. data/webpack/scenes/Subscriptions/Details/SubscriptionDetailReducer.js +37 -0
  143. data/webpack/scenes/Subscriptions/Details/SubscriptionDetails.js +58 -0
  144. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailActions.test.js +47 -0
  145. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailAssociations.test.js +16 -0
  146. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailInfo.test.js +15 -0
  147. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailProducts.test.js +16 -0
  148. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetailReducer.test.js +39 -0
  149. data/webpack/scenes/Subscriptions/Details/__tests__/SubscriptionDetails.test.js +28 -0
  150. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailAssociations.test.js.snap +53 -0
  151. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailInfo.test.js.snap +185 -0
  152. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetailProducts.test.js.snap +77 -0
  153. data/webpack/scenes/Subscriptions/Details/__tests__/__snapshots__/SubscriptionDetails.test.js.snap +432 -0
  154. data/webpack/scenes/Subscriptions/Details/__tests__/subscriptionDetails.fixtures.js +167 -0
  155. data/webpack/scenes/Subscriptions/Details/index.js +19 -0
  156. data/webpack/scenes/Subscriptions/Manifest/ManageManifestModal.js +58 -12
  157. data/webpack/scenes/Subscriptions/Manifest/Manifest.scss +6 -1
  158. data/webpack/scenes/Subscriptions/Manifest/ManifestActions.js +4 -4
  159. data/webpack/scenes/Subscriptions/Manifest/ManifestHistoryTableSchema.js +7 -7
  160. data/webpack/scenes/Subscriptions/Manifest/__tests__/__snapshots__/ManageManifestModal.test.js.snap +6 -9
  161. data/webpack/scenes/Subscriptions/Manifest/index.js +2 -2
  162. data/webpack/scenes/Subscriptions/SubscriptionActions.js +5 -6
  163. data/webpack/scenes/Subscriptions/SubscriptionReducer.js +2 -3
  164. data/webpack/scenes/Subscriptions/SubscriptionValidations.js +1 -1
  165. data/webpack/scenes/Subscriptions/SubscriptionsPage.js +46 -30
  166. data/webpack/scenes/Subscriptions/SubscriptionsPage.scss +38 -0
  167. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsActions.js +3 -3
  168. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsPage.js +7 -6
  169. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/UpstreamSubscriptionsTableSchema.js +17 -14
  170. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/__snapshots__/UpstreamSubscriptionsPage.test.js.snap +12 -15
  171. data/webpack/scenes/Subscriptions/UpstreamSubscriptions/__tests__/upstreamSubscriptions.fixtures.js +4 -4
  172. data/webpack/scenes/Subscriptions/__tests__/SubscriptionValidations.test.js +5 -0
  173. data/webpack/scenes/Subscriptions/__tests__/subscriptions.fixtures.js +2 -2
  174. data/webpack/scenes/Subscriptions/{EntitlementsInlineEditFormatter.js → components/SubscriptionsTable/EntitlementsInlineEditFormatter.js} +7 -7
  175. data/webpack/scenes/Subscriptions/{SubscriptionsTable.js → components/SubscriptionsTable/SubscriptionsTable.js} +75 -47
  176. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/SubscriptionsTableHelpers.js +60 -0
  177. data/webpack/scenes/Subscriptions/{SubscriptionsTableSchema.js → components/SubscriptionsTable/SubscriptionsTableSchema.js} +37 -26
  178. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/__tests__/SubscriptionsTable.test.js +56 -0
  179. data/webpack/scenes/Subscriptions/{__tests__ → components/SubscriptionsTable/__tests__}/__snapshots__/SubscriptionsTable.test.js.snap +16 -5
  180. data/webpack/scenes/Subscriptions/components/SubscriptionsTable/index.js +2 -0
  181. data/webpack/scenes/Subscriptions/index.js +2 -2
  182. data/webpack/scenes/Tasks/TaskActions.js +18 -11
  183. data/webpack/scenes/Tasks/__tests__/TaskActions.test.js +92 -9
  184. data/webpack/scenes/Tasks/__tests__/task.fixtures.js +19 -9
  185. data/webpack/services/api/index.js +2 -2
  186. data/webpack/test_setup.js +1 -0
  187. metadata +79 -10
  188. data/webpack/scenes/Subscriptions/Subscriptions.scss +0 -14
  189. data/webpack/scenes/Subscriptions/__tests__/SubscriptionsTable.test.js +0 -47
@@ -0,0 +1,47 @@
1
+ import thunk from 'redux-thunk';
2
+ import Immutable from 'seamless-immutable';
3
+ import configureMockStore from 'redux-mock-store';
4
+ import { mockRequest, mockErrorRequest, mockReset } from '../../../../mockRequest';
5
+ import { loadSubscriptionDetails } from '../SubscriptionDetailActions';
6
+ import {
7
+ loadSubscriptionsDetailsSuccessActions,
8
+ loadSubscriptionsDetailsFailureActions,
9
+ subDetails,
10
+ } from './subscriptionDetails.fixtures';
11
+
12
+ const mockStore = configureMockStore([thunk]);
13
+ const store = mockStore({ subscriptionDetails: Immutable({}) });
14
+ const endpoint = /\/organizations\/\d+\/subscriptions\/\d+/;
15
+
16
+ afterEach(() => {
17
+ store.clearActions();
18
+ mockReset();
19
+ });
20
+
21
+ describe('subscription detail actions', () => {
22
+ describe('loadSubscriptionDetails', () => {
23
+ it(
24
+ 'creates SUBSCRIPTION_DETAILS_REQUEST and then fails with 500',
25
+ () => {
26
+ mockErrorRequest({
27
+ url: endpoint,
28
+ });
29
+ return store.dispatch(loadSubscriptionDetails(1))
30
+ .then(() => expect(store.getActions())
31
+ .toEqual(loadSubscriptionsDetailsFailureActions));
32
+ },
33
+ );
34
+ it(
35
+ 'creates SUBSCRIPTION_DETAILS_SUCCESS and ends with success',
36
+ () => {
37
+ mockRequest({
38
+ url: endpoint,
39
+ response: subDetails,
40
+ });
41
+ return store.dispatch(loadSubscriptionDetails(1))
42
+ .then(() => expect(store.getActions())
43
+ .toEqual(loadSubscriptionsDetailsSuccessActions));
44
+ },
45
+ );
46
+ });
47
+ });
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import TestRenderer from 'react-test-renderer';
3
+ import SubscriptionDetailAssociations from '../SubscriptionDetailAssociations';
4
+ import { successState } from './subscriptionDetails.fixtures';
5
+
6
+ describe('subscriptions detail associations page', () => {
7
+ it('renders correctly', () => {
8
+ const testRenderer = TestRenderer
9
+ .create(<SubscriptionDetailAssociations subscriptionDetails={successState} />);
10
+ const testInstance = testRenderer.root;
11
+
12
+ expect(testRenderer.toJSON()).toMatchSnapshot();
13
+ expect(testInstance.findAllByType('td')).toHaveLength(6);
14
+ expect(testInstance.findAllByType('a')).toHaveLength(2);
15
+ });
16
+ });
@@ -0,0 +1,15 @@
1
+ import React from 'react';
2
+ import TestRenderer from 'react-test-renderer';
3
+ import SubscriptionDetailInfo from '../SubscriptionDetailInfo';
4
+ import { successState } from './subscriptionDetails.fixtures';
5
+
6
+ describe('subscriptions detail associations page', () => {
7
+ it('renders correctly', () => {
8
+ const testRenderer = TestRenderer
9
+ .create(<SubscriptionDetailInfo subscriptionDetails={successState} />);
10
+ const testInstance = testRenderer.root;
11
+
12
+ expect(testRenderer.toJSON()).toMatchSnapshot();
13
+ expect(testInstance.findByType('h2').children[0]).toBe('Subscription Info');
14
+ });
15
+ });
@@ -0,0 +1,16 @@
1
+ import React from 'react';
2
+ import TestRenderer from 'react-test-renderer';
3
+ import SubscriptionDetailProducts from '../SubscriptionDetailProducts';
4
+ import { successState } from './subscriptionDetails.fixtures';
5
+
6
+ describe('subscription detail product page', () => {
7
+ it('renders correctly', () => {
8
+ const testRenderer = TestRenderer
9
+ .create(<SubscriptionDetailProducts subscriptionDetails={successState} />);
10
+ const testInstance = testRenderer.root;
11
+
12
+ expect(testRenderer.toJSON()).toMatchSnapshot();
13
+ expect(testInstance.findByType('h2').children[0]).toBe('Provided Products');
14
+ expect(testInstance.findAllByType('li')).toHaveLength(successState.provided_products.length);
15
+ });
16
+ });
@@ -0,0 +1,39 @@
1
+ import * as types from '../SubscriptionDetailConstants';
2
+
3
+ import {
4
+ initialState,
5
+ loadingState,
6
+ subDetails,
7
+ successState,
8
+ } from './subscriptionDetails.fixtures';
9
+ import reducer from '../SubscriptionDetailReducer';
10
+
11
+ describe('subscriptions reducer', () => {
12
+ it('should return the initial state', () => {
13
+ expect(reducer(undefined, {})).toEqual(initialState);
14
+ });
15
+
16
+ it('should keep loading state on SUBSCRIPTION_DETAILS_REQUEST', () => {
17
+ expect(reducer(initialState, {
18
+ type: types.SUBSCRIPTION_DETAILS_REQUEST,
19
+ })).toEqual(loadingState);
20
+ });
21
+
22
+ it('load subscription details on SUBSCRIPTION_DETAILS_SUCCESS', () => {
23
+ expect(reducer(initialState, {
24
+ type: types.SUBSCRIPTION_DETAILS_SUCCESS,
25
+ response: subDetails,
26
+ })).toEqual(successState);
27
+ });
28
+
29
+ it('load error on SUBSCRIPTION_DETAILS_FAILURE', () => {
30
+ const error = 'nothing worked';
31
+ expect(reducer(initialState, {
32
+ type: types.SUBSCRIPTION_DETAILS_FAILURE,
33
+ error,
34
+ })).toEqual({
35
+ ...initialState,
36
+ error,
37
+ });
38
+ });
39
+ });
@@ -0,0 +1,28 @@
1
+ import React from 'react';
2
+ import { shallow } from 'enzyme';
3
+ import toJson from 'enzyme-to-json';
4
+ import SubscriptionDetails from '../SubscriptionDetails';
5
+ import SubscriptionDetailAssociations from '../SubscriptionDetailAssociations';
6
+ import SubscriptionDetailInfo from '../SubscriptionDetailInfo';
7
+ import SubscriptionDetailProducts from '../SubscriptionDetailProducts';
8
+ import { loadSubscriptionDetails } from '../SubscriptionDetailActions';
9
+ import { successState } from './subscriptionDetails.fixtures';
10
+
11
+ jest.mock('../../../../move_to_foreman/foreman_toast_notifications');
12
+
13
+ describe('subscriptions details page', () => {
14
+ it('should render and contain appropiate components', async () => {
15
+ const match = { params: { id: 1 } };
16
+
17
+ const wrapper = shallow(<SubscriptionDetails
18
+ loadSubscriptionDetails={loadSubscriptionDetails}
19
+ subscriptionDetails={successState}
20
+ match={match}
21
+ />);
22
+ expect(wrapper.find('h1').text()).toEqual(successState.name);
23
+ expect(wrapper.find(SubscriptionDetailAssociations)).toHaveLength(1);
24
+ expect(wrapper.find(SubscriptionDetailInfo)).toHaveLength(1);
25
+ expect(wrapper.find(SubscriptionDetailProducts)).toHaveLength(1);
26
+ expect(toJson(wrapper)).toMatchSnapshot();
27
+ });
28
+ });
@@ -0,0 +1,53 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`subscriptions detail associations page renders correctly 1`] = `
4
+ <div>
5
+ <h2>
6
+ Associations
7
+ </h2>
8
+ <table
9
+ className="table table-striped table-bordered table-condensed table-hover"
10
+ >
11
+ <thead>
12
+ <tr>
13
+ <td>
14
+ <b>
15
+ Resource
16
+ </b>
17
+ </td>
18
+ <td>
19
+ <b>
20
+ Quantity
21
+ </b>
22
+ </td>
23
+ </tr>
24
+ </thead>
25
+ <tbody>
26
+ <tr>
27
+ <td>
28
+ Content Hosts
29
+ </td>
30
+ <td>
31
+ <a
32
+ href="/content_hosts?search=subscription_id=\\"48\\""
33
+ >
34
+ 0
35
+ </a>
36
+ </td>
37
+ </tr>
38
+ <tr>
39
+ <td>
40
+ Activation Keys
41
+ </td>
42
+ <td>
43
+ <a
44
+ href="/activation_keys?search=subscription_id=\\"48\\""
45
+ >
46
+ 0
47
+ </a>
48
+ </td>
49
+ </tr>
50
+ </tbody>
51
+ </table>
52
+ </div>
53
+ `;
@@ -0,0 +1,185 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`subscriptions detail associations page renders correctly 1`] = `
4
+ <div>
5
+ <h2>
6
+ Subscription Info
7
+ </h2>
8
+ <table
9
+ className="table"
10
+ >
11
+ <tbody>
12
+ <tr>
13
+ <td>
14
+ <b>
15
+ Name
16
+ </b>
17
+ </td>
18
+ <td>
19
+ OpenShift Employee Subscription
20
+ </td>
21
+ </tr>
22
+ <tr>
23
+ <td>
24
+ <b>
25
+ Description
26
+ </b>
27
+ </td>
28
+ <td>
29
+ OpenShift Enterprise
30
+ </td>
31
+ </tr>
32
+ <tr>
33
+ <td>
34
+ <b>
35
+ Requires Virt-Who
36
+ </b>
37
+ </td>
38
+ <td>
39
+ false
40
+ </td>
41
+ </tr>
42
+ <tr>
43
+ <td>
44
+ <b>
45
+ Consumed
46
+ </b>
47
+ </td>
48
+ <td>
49
+ 0
50
+ </td>
51
+ </tr>
52
+ <tr>
53
+ <td>
54
+ <b>
55
+ Starts
56
+ </b>
57
+ </td>
58
+ <td>
59
+ 2013-03-01 00:00:00 -0500
60
+ </td>
61
+ </tr>
62
+ <tr>
63
+ <td>
64
+ <b>
65
+ Ends
66
+ </b>
67
+ </td>
68
+ <td>
69
+ 2021-12-31 23:59:59 -0500
70
+ </td>
71
+ </tr>
72
+ <tr>
73
+ <td>
74
+ <b>
75
+ Product ID
76
+ </b>
77
+ </td>
78
+ <td>
79
+ SER0421
80
+ </td>
81
+ </tr>
82
+ <tr>
83
+ <td>
84
+ <b>
85
+ Contract Number
86
+ </b>
87
+ </td>
88
+ <td>
89
+ 10126160
90
+ </td>
91
+ </tr>
92
+ <tr>
93
+ <td>
94
+ <b>
95
+ Account Number
96
+ </b>
97
+ </td>
98
+ <td>
99
+ 1212729
100
+ </td>
101
+ </tr>
102
+ <tr>
103
+ <td>
104
+ <b>
105
+ Support Level
106
+ </b>
107
+ </td>
108
+ <td>
109
+ Self-Support
110
+ </td>
111
+ </tr>
112
+ <tr>
113
+ <td>
114
+ <b>
115
+ Support Type
116
+ </b>
117
+ </td>
118
+ <td>
119
+ L1-L3
120
+ </td>
121
+ </tr>
122
+ <tr>
123
+ <td>
124
+ <b>
125
+ Architecture(s)
126
+ </b>
127
+ </td>
128
+ <td>
129
+ ia64,ppc,ppc64,ppc64le,s390,s390x,x86,x86_64
130
+ </td>
131
+ </tr>
132
+ <tr>
133
+ <td>
134
+ <b>
135
+ Type
136
+ </b>
137
+ </td>
138
+ <td>
139
+ NORMAL
140
+ </td>
141
+ </tr>
142
+ <tr>
143
+ <td>
144
+ <b>
145
+ Multi-entitlement
146
+ </b>
147
+ </td>
148
+ <td>
149
+
150
+ </td>
151
+ </tr>
152
+ <tr>
153
+ <td>
154
+ <b>
155
+ Stacking ID
156
+ </b>
157
+ </td>
158
+ <td>
159
+ SER0421
160
+ </td>
161
+ </tr>
162
+ <tr>
163
+ <td>
164
+ <b>
165
+ Limits
166
+ </b>
167
+ </td>
168
+ <td>
169
+ Cores: 4
170
+ </td>
171
+ </tr>
172
+ <tr>
173
+ <td>
174
+ <b>
175
+ Instance-based
176
+ </b>
177
+ </td>
178
+ <td>
179
+ Yes
180
+ </td>
181
+ </tr>
182
+ </tbody>
183
+ </table>
184
+ </div>
185
+ `;
@@ -0,0 +1,77 @@
1
+ // Jest Snapshot v1, https://goo.gl/fbAQLP
2
+
3
+ exports[`subscription detail product page renders correctly 1`] = `
4
+ <div>
5
+ <h2>
6
+ Provided Products
7
+ </h2>
8
+ <ul>
9
+ <li>
10
+ Red Hat OpenShift Container Platform
11
+ </li>
12
+ <li>
13
+ Oracle Java for RHEL Server
14
+ </li>
15
+ <li>
16
+ Red Hat OpenShift Enterprise JBoss EAP add-on
17
+ </li>
18
+ <li>
19
+ Red Hat CloudForms Beta
20
+ </li>
21
+ <li>
22
+ Red Hat CloudForms
23
+ </li>
24
+ <li>
25
+ Red Hat OpenShift Enterprise Client Tools
26
+ </li>
27
+ <li>
28
+ Red Hat Enterprise Linux Atomic Host
29
+ </li>
30
+ <li>
31
+ JBoss Enterprise Application Platform
32
+ </li>
33
+ <li>
34
+ Red Hat JBoss AMQ Clients
35
+ </li>
36
+ <li>
37
+ Red Hat Beta
38
+ </li>
39
+ <li>
40
+ Red Hat OpenShift Enterprise Infrastructure
41
+ </li>
42
+ <li>
43
+ Red Hat Enterprise Linux Fast Datapath Beta
44
+ </li>
45
+ <li>
46
+ Red Hat Ansible Engine
47
+ </li>
48
+ <li>
49
+ Red Hat OpenShift Enterprise Application Node
50
+ </li>
51
+ <li>
52
+ Red Hat OpenShift Enterprise JBoss FUSE add-on
53
+ </li>
54
+ <li>
55
+ Red Hat Software Collections Beta for RHEL Server
56
+ </li>
57
+ <li>
58
+ Red Hat Software Collections for RHEL Server
59
+ </li>
60
+ <li>
61
+ Red Hat Enterprise Linux Fast Datapath
62
+ </li>
63
+ <li>
64
+ Red Hat Enterprise Linux Server
65
+ </li>
66
+ <li>
67
+ Red Hat OpenShift Enterprise JBoss A-MQ add-on
68
+ </li>
69
+ <li>
70
+ JBoss Enterprise Web Server
71
+ </li>
72
+ <li>
73
+ Red Hat JBoss Core Services
74
+ </li>
75
+ </ul>
76
+ </div>
77
+ `;