foreman_rh_cloud 1.0.5 → 2.0.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -0
- data/app/controllers/foreman_inventory_upload/accounts_controller.rb +2 -6
- data/app/controllers/foreman_rh_cloud/react_controller.rb +8 -0
- data/app/models/setting/rh_cloud.rb +1 -0
- data/app/views/foreman_rh_cloud/react/inventory_upload.html.erb +1 -0
- data/app/views/{foreman_inventory_upload/layouts/react.html.erb → layouts/foreman_rh_cloud/application.html.erb} +2 -2
- data/config/routes.rb +4 -1
- data/lib/foreman_inventory_upload/async/async_helpers.rb +13 -0
- data/lib/foreman_inventory_upload/async/shell_process.rb +3 -1
- data/lib/foreman_inventory_upload/async/upload_report_job.rb +1 -5
- data/lib/foreman_inventory_upload/generators/fact_helpers.rb +56 -0
- data/lib/foreman_inventory_upload/generators/queries.rb +6 -0
- data/lib/foreman_inventory_upload/generators/slice.rb +14 -9
- data/lib/foreman_rh_cloud/engine.rb +17 -5
- data/lib/foreman_rh_cloud/version.rb +1 -1
- data/package.json +20 -100
- data/test/factories/inventory_upload_factories.rb +13 -13
- data/test/unit/archived_report_generator_test.rb +1 -0
- data/test/unit/fact_helpers_test.rb +29 -0
- data/test/unit/slice_generator_test.rb +206 -20
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.fixtures.js +6 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.js +13 -10
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountList.stories.js +5 -14
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListActions.js +3 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListHelper.js +10 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/AccountListSelectors.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/EmptyResults.js +15 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/EmptyResults.test.js +13 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/__tests__/__snapshots__/EmptyResults.test.js.snap +18 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/emptyResults.scss +7 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyResults/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/EmptyState/__tests__/EmptyState.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ErrorState/__tests__/ErrorState.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/ListItem.js +1 -4
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItem/__tests__/ListItem.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/Components/ListItemStatus/__tests__/ListItemStatus.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountList.test.js +2 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListActions.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListHelper.test.js +12 -0
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListIntegration.test.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListReducer.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/AccountListSelectors.test.js +8 -9
- data/webpack/ForemanInventoryUpload/Components/AccountList/__tests__/__snapshots__/AccountList.test.js.snap +2 -3
- data/webpack/ForemanInventoryUpload/Components/AccountList/index.js +2 -0
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/AutoUploadSwitcherActions.js +4 -1
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcher.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/AutoUploadSwitcher/__tests__/AutoUploadSwitcherActions.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.fixtures.js +13 -9
- data/webpack/ForemanInventoryUpload/Components/Dashboard/Dashboard.stories.js +5 -15
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardActions.js +4 -3
- data/webpack/ForemanInventoryUpload/Components/Dashboard/DashboardSelectors.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/Dashboard.test.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardActions.test.js +17 -5
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardIntegration.test.js +2 -2
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardReducer.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Dashboard/__tests__/DashboardSelectors.test.js +4 -3
- data/webpack/ForemanInventoryUpload/Components/FileDownload/__tests__/FileDownload.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/FullScreenModal/__tests__/FullScreenModal.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/ClearButton.js +26 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/Components/ClearButton/index.js +1 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.fixtures.js +2 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilter.js +39 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterActions.js +16 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterConstants.js +3 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterReducer.js +36 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/InventoryFilterSelectors.js +7 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilter.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterActions.test.js +14 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterReducer.test.js +35 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/InventoryFilterSelectors.test.js +21 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/__snapshots__/InventoryFilter.test.js.snap +25 -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 +25 -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 +31 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/__tests__/integration.test.js +18 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/index.js +17 -0
- data/webpack/ForemanInventoryUpload/Components/InventoryFilter/inventoryFilter.scss +28 -0
- data/webpack/ForemanInventoryUpload/Components/NavContainer/NavContainer.fixtures.js +5 -2
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/NavContainer.test.js +1 -2
- data/webpack/ForemanInventoryUpload/Components/NavContainer/__tests__/__snapshots__/NavContainer.test.js.snap +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/PageHeader.js +12 -3
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/PageHeader.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/PageHeader/__tests__/__snapshots__/PageHeader.test.js.snap +11 -2
- data/webpack/ForemanInventoryUpload/Components/PageHeader/pageHeader.scss +3 -0
- data/webpack/ForemanInventoryUpload/Components/ReportGenerate/__tests__/ReportGenerate.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ReportUpload/__tests__/ReportUpload.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/ScheduledRun/__tests__/ScheduledRun.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/StatusChart/__tests__/StatusChart.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabBody/__tests__/TabBody.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabContainer/__tests__/TabContainer.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabFooter/__tests__/TabFooter.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/TabHeader/__tests__/TabHeader.test.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/Terminal.js +1 -1
- data/webpack/ForemanInventoryUpload/Components/Terminal/__tests__/Terminal.test.js +1 -2
- data/webpack/ForemanInventoryUpload/ForemanInventoryConstants.js +3 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryHelpers.js +4 -0
- data/webpack/ForemanInventoryUpload/ForemanInventoryUpload.js +16 -8
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadReducers.js +4 -4
- data/webpack/ForemanInventoryUpload/__tests__/ForemanInventoryHelpers.test.js +9 -0
- data/webpack/ForemanInventoryUpload/{ForemanInventoryUpload.test.js → __tests__/ForemanInventoryUpload.test.js} +2 -2
- data/webpack/ForemanInventoryUpload/__tests__/__snapshots__/ForemanInventoryHelpers.test.js.snap +3 -0
- data/webpack/ForemanInventoryUpload/{__snapshots__ → __tests__/__snapshots__}/ForemanInventoryUpload.test.js.snap +0 -0
- data/webpack/ForemanRhCloudHelpers.js +6 -0
- data/webpack/ForemanRhCloudReducers.js +8 -0
- data/webpack/ForemanRhCloudSelectors.js +3 -0
- data/webpack/ForemanRhCloudTestHelpers.js +5 -0
- data/webpack/__mocks__/foremanReact/components/Layout/LayoutConstants.js +1 -0
- data/webpack/__tests__/ForemanRhCloudHelpers.test.js +11 -0
- data/webpack/__tests__/ForemanRhCloudSelectors.test.js +17 -0
- data/webpack/__tests__/ForemanRhCloudTestHelpers.test.js +10 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudHelpers.test.js.snap +3 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudSelectors.test.js.snap +15 -0
- data/webpack/__tests__/__snapshots__/ForemanRhCloudTestHelpers.test.js.snap +11 -0
- data/webpack/index.js +1 -1
- metadata +52 -14
- data/app/controllers/foreman_inventory_upload/react_controller.rb +0 -7
- data/webpack/ForemanInventoryUpload/ForemanInventoryUploadSelectors.js +0 -4
- data/webpack/stories/ForemanInventoryUploadReducers.js +0 -3
- data/webpack/stories/configureStore.js +0 -15
- data/webpack/stories/decorators/index.js +0 -1
- data/webpack/stories/decorators/withCardsDecorator.js +0 -14
- data/webpack/stories/index.js +0 -10
- data/webpack/stories/index.scss +0 -7
- data/webpack/test_setup.js +0 -6
@@ -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,31 @@
|
|
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_new_filter",
|
10
|
+
},
|
11
|
+
"type": "INVENTORY_FILTER_UPDATE",
|
12
|
+
},
|
13
|
+
],
|
14
|
+
],
|
15
|
+
"state": Object {
|
16
|
+
"ForemanRhCloud": Object {
|
17
|
+
"inventoryUpload": Object {
|
18
|
+
"accountsList": Object {
|
19
|
+
"accounts": Object {},
|
20
|
+
"error": null,
|
21
|
+
"pollingProcessID": 0,
|
22
|
+
},
|
23
|
+
"dashboard": Object {},
|
24
|
+
"inventoryFilter": Object {
|
25
|
+
"filterTerm": "some_new_filter",
|
26
|
+
},
|
27
|
+
},
|
28
|
+
},
|
29
|
+
},
|
30
|
+
}
|
31
|
+
`;
|
@@ -0,0 +1,18 @@
|
|
1
|
+
import React from 'react';
|
2
|
+
import { IntegrationTestHelper } from '@theforeman/test';
|
3
|
+
import InventoryFilter from '../index';
|
4
|
+
import reducers from '../../../../ForemanRhCloudReducers';
|
5
|
+
|
6
|
+
describe('InventoryFilter integration test', () => {
|
7
|
+
it('should flow', async () => {
|
8
|
+
const integrationTestHelper = new IntegrationTestHelper(reducers);
|
9
|
+
const wrapper = integrationTestHelper.mount(<InventoryFilter />);
|
10
|
+
const input = wrapper.find('#inventory_filter_input');
|
11
|
+
input.simulate('change', { target: { value: 'some_new_filter' } });
|
12
|
+
await IntegrationTestHelper.flushAllPromises();
|
13
|
+
wrapper.update();
|
14
|
+
integrationTestHelper.takeStoreAndLastActionSnapshot(
|
15
|
+
'filter have been updated'
|
16
|
+
);
|
17
|
+
});
|
18
|
+
});
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { bindActionCreators } from 'redux';
|
2
|
+
import { connect } from 'react-redux';
|
3
|
+
import reducer from './InventoryFilterReducer';
|
4
|
+
import * as actions from './InventoryFilterActions';
|
5
|
+
import InventoryFilter from './InventoryFilter';
|
6
|
+
import { selectFilterTerm } from './InventoryFilterSelectors';
|
7
|
+
|
8
|
+
export const reducers = { inventoryFilter: reducer };
|
9
|
+
|
10
|
+
const mapStateToProps = state => ({
|
11
|
+
filterTerm: selectFilterTerm(state),
|
12
|
+
});
|
13
|
+
// map action dispatchers to props
|
14
|
+
const mapDispatchToProps = dispatch => bindActionCreators(actions, dispatch);
|
15
|
+
|
16
|
+
// export connected component
|
17
|
+
export default connect(mapStateToProps, mapDispatchToProps)(InventoryFilter);
|
@@ -0,0 +1,28 @@
|
|
1
|
+
#inventory_filter_form {
|
2
|
+
.form-group {
|
3
|
+
display: -ms-flexbox;
|
4
|
+
display: -webkit-flex;
|
5
|
+
display: flex;
|
6
|
+
-webkit-flex-direction: row;
|
7
|
+
-ms-flex-direction: row;
|
8
|
+
flex-direction: row;
|
9
|
+
-webkit-flex-wrap: nowrap;
|
10
|
+
-ms-flex-wrap: nowrap;
|
11
|
+
flex-wrap: nowrap;
|
12
|
+
-webkit-justify-content: flex-end;
|
13
|
+
-ms-flex-pack: end;
|
14
|
+
justify-content: flex-end;
|
15
|
+
-webkit-align-content: center;
|
16
|
+
-ms-flex-line-pack: center;
|
17
|
+
align-content: center;
|
18
|
+
-webkit-align-items: center;
|
19
|
+
-ms-flex-align: center;
|
20
|
+
align-items: center;
|
21
|
+
margin-bottom: 0;
|
22
|
+
|
23
|
+
.inventory-clear-button {
|
24
|
+
position: absolute;
|
25
|
+
right: 27px;
|
26
|
+
}
|
27
|
+
}
|
28
|
+
}
|
@@ -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:
|
7
|
-
onClick:
|
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 '
|
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
|
|
@@ -1,21 +1,30 @@
|
|
1
1
|
import React from 'react';
|
2
2
|
import { Grid } from 'patternfly-react';
|
3
|
-
import { translate as __ } from 'foremanReact/common/I18n';
|
4
3
|
import AutoUploadSwitcher from '../AutoUploadSwitcher';
|
4
|
+
import InventoryFilter from '../InventoryFilter';
|
5
|
+
import { INVENTORY_PAGE_TITLE } from '../../ForemanInventoryConstants';
|
6
|
+
import './pageHeader.scss';
|
5
7
|
|
6
8
|
const PageHeader = () => (
|
7
9
|
<React.Fragment>
|
8
10
|
<Grid.Row>
|
9
11
|
<Grid.Col xs={12}>
|
10
|
-
<h1>{
|
12
|
+
<h1 className="inventory_title">{INVENTORY_PAGE_TITLE}</h1>
|
11
13
|
</Grid.Col>
|
12
14
|
</Grid.Row>
|
13
15
|
<Grid.Row>
|
14
|
-
<Grid.Col xs={
|
16
|
+
<Grid.Col xs={3}>
|
17
|
+
<InventoryFilter />
|
18
|
+
</Grid.Col>
|
19
|
+
<Grid.Col xs={4} xsOffset={5}>
|
15
20
|
<AutoUploadSwitcher />
|
16
21
|
</Grid.Col>
|
17
22
|
</Grid.Row>
|
18
23
|
</React.Fragment>
|
19
24
|
);
|
20
25
|
|
26
|
+
PageHeader.propTypes = {};
|
27
|
+
|
28
|
+
PageHeader.defaultProps = {};
|
29
|
+
|
21
30
|
export default PageHeader;
|
@@ -11,7 +11,9 @@ exports[`PageHeader rendering render without Props 1`] = `
|
|
11
11
|
componentClass="div"
|
12
12
|
xs={12}
|
13
13
|
>
|
14
|
-
<h1
|
14
|
+
<h1
|
15
|
+
className="inventory_title"
|
16
|
+
>
|
15
17
|
Red Hat Inventory Uploads
|
16
18
|
</h1>
|
17
19
|
</Col>
|
@@ -20,11 +22,18 @@ exports[`PageHeader rendering render without Props 1`] = `
|
|
20
22
|
bsClass="row"
|
21
23
|
componentClass="div"
|
22
24
|
>
|
25
|
+
<Col
|
26
|
+
bsClass="col"
|
27
|
+
componentClass="div"
|
28
|
+
xs={3}
|
29
|
+
>
|
30
|
+
<Connect(InventoryFilter) />
|
31
|
+
</Col>
|
23
32
|
<Col
|
24
33
|
bsClass="col"
|
25
34
|
componentClass="div"
|
26
35
|
xs={4}
|
27
|
-
xsOffset={
|
36
|
+
xsOffset={5}
|
28
37
|
>
|
29
38
|
<Connect(AutoUploadSwitcher) />
|
30
39
|
</Col>
|
@@ -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
|
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 '
|
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
|
|
@@ -3,14 +3,22 @@ import { IntlProvider } from 'react-intl';
|
|
3
3
|
import { Grid } from 'patternfly-react';
|
4
4
|
import AccountList from './Components/AccountList';
|
5
5
|
import PageHeader from './Components/PageHeader';
|
6
|
+
import { INVENTORY_PAGE_TITLE } from './ForemanInventoryConstants';
|
6
7
|
|
7
|
-
const ForemanInventoryUpload = () =>
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
|
13
|
-
|
14
|
-
|
8
|
+
const ForemanInventoryUpload = () => {
|
9
|
+
document.title = INVENTORY_PAGE_TITLE;
|
10
|
+
return (
|
11
|
+
<IntlProvider locale={navigator.language}>
|
12
|
+
<Grid fluid className="inventory-upload">
|
13
|
+
<PageHeader />
|
14
|
+
<AccountList />
|
15
|
+
</Grid>
|
16
|
+
</IntlProvider>
|
17
|
+
);
|
18
|
+
};
|
19
|
+
|
20
|
+
ForemanInventoryUpload.propTypes = {};
|
21
|
+
|
22
|
+
ForemanInventoryUpload.defaultProps = {};
|
15
23
|
|
16
24
|
export default ForemanInventoryUpload;
|
@@ -1,12 +1,12 @@
|
|
1
1
|
import { combineReducers } from 'redux';
|
2
2
|
import { reducers as accountListReducers } from './Components/AccountList';
|
3
3
|
import { reducers as dashboardReducers } from './Components/Dashboard';
|
4
|
+
import { reducers as filterReducers } from './Components/InventoryFilter';
|
4
5
|
|
5
|
-
|
6
|
-
|
6
|
+
export default {
|
7
|
+
inventoryUpload: combineReducers({
|
7
8
|
...accountListReducers,
|
8
9
|
...dashboardReducers,
|
10
|
+
...filterReducers,
|
9
11
|
}),
|
10
12
|
};
|
11
|
-
|
12
|
-
export default reducers;
|
@@ -0,0 +1,9 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { inventoryUrl } from '../ForemanInventoryHelpers';
|
3
|
+
|
4
|
+
const fixtures = {
|
5
|
+
'should return inventory Url': () => inventoryUrl('test_path'),
|
6
|
+
};
|
7
|
+
|
8
|
+
describe('ForemanInventoryUpload helpers', () =>
|
9
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
@@ -1,6 +1,6 @@
|
|
1
|
-
import { testComponentSnapshotsWithFixtures } from '
|
1
|
+
import { testComponentSnapshotsWithFixtures } from '@theforeman/test';
|
2
2
|
|
3
|
-
import ForemanInventoryUpload from '
|
3
|
+
import ForemanInventoryUpload from '../../ForemanInventoryUpload';
|
4
4
|
|
5
5
|
const fixtures = {
|
6
6
|
'render without Props': {},
|
File without changes
|
@@ -0,0 +1 @@
|
|
1
|
+
export const LAYOUT_CHANGE_ORG = 'LAYOUT_CHANGE_ORG';
|
@@ -0,0 +1,11 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { foremanUrl } from '../ForemanRhCloudHelpers';
|
3
|
+
|
4
|
+
global.URL_PREFIX = 'MY_TEST_URL_PREFIX.example.com';
|
5
|
+
|
6
|
+
const fixtures = {
|
7
|
+
'should return foreman Url': () => foremanUrl('/test_path'),
|
8
|
+
};
|
9
|
+
|
10
|
+
describe('ForemanRhCloud helpers', () =>
|
11
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|
@@ -0,0 +1,17 @@
|
|
1
|
+
import { testSelectorsSnapshotWithFixtures } from '@theforeman/test';
|
2
|
+
import { inventoryStateWrapper } from '../ForemanRhCloudTestHelpers';
|
3
|
+
import {
|
4
|
+
selectForemanRhCloud,
|
5
|
+
selectForemanInventoryUpload,
|
6
|
+
} from '../ForemanRhCloudSelectors';
|
7
|
+
|
8
|
+
const state = inventoryStateWrapper({ inventoryReducersNamespaces: {} });
|
9
|
+
|
10
|
+
const fixtures = {
|
11
|
+
'should return ForemanRhCloud': () => selectForemanRhCloud(state),
|
12
|
+
'should return ForemanInventoryUpload': () =>
|
13
|
+
selectForemanInventoryUpload(state),
|
14
|
+
};
|
15
|
+
|
16
|
+
describe('ForemanRhCloud selectors', () =>
|
17
|
+
testSelectorsSnapshotWithFixtures(fixtures));
|