Skip to content

Commit

Permalink
Refs #29637 - Removing some mocks and updating snapshots
Browse files Browse the repository at this point in the history
  • Loading branch information
John Mitsch committed Apr 28, 2020
1 parent 74c9c0c commit 8600695
Show file tree
Hide file tree
Showing 21 changed files with 40 additions and 114 deletions.
29 changes: 0 additions & 29 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -61,34 +61,5 @@
"ngreact": "^0.5.0",
"query-string": "^6.1.0",
"react-bootstrap": "^0.32.1"
},
"jest": {
"collectCoverage": true,
"collectCoverageFrom": [
"webpack/**/*.js",
"!webpack/**/bundle*"
],
"coverageReporters": [
"lcov"
],
"testURL": "http://localhost/",
"setupFiles": [
"raf/polyfill",
"./webpack/test_setup.js"
],
"setupTestFrameworkScriptFile": "./webpack/global_test_setup.js",
"testPathIgnorePatterns": [
"/node_modules/",
"<rootDir>/foreman/",
"<rootDir>/.+fixtures.+",
"<rootDir>/engines"
],
"moduleDirectories": [
"node_modules/@theforeman/vendor-core/node_modules",
"node_modules"
],
"moduleNameMapper": {
"^.+\\.(css|scss)$": "identity-obj-proxy"
}
}
}
5 changes: 0 additions & 5 deletions webpack/__mocks__/foremanReact/common/I18n.js

This file was deleted.

21 changes: 0 additions & 21 deletions webpack/__mocks__/foremanReact/common/helpers.js

This file was deleted.

8 changes: 0 additions & 8 deletions webpack/__mocks__/foremanReact/common/keyCodes.js

This file was deleted.

Original file line number Diff line number Diff line change
@@ -1,3 +1,2 @@

const BreadcrumbsBar = () => jest.fn();
export default BreadcrumbsBar;

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

This file was deleted.

6 changes: 0 additions & 6 deletions webpack/__mocks__/foremanReact/components/common/table.js

This file was deleted.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ exports[`Table renders Table with pagination 1`] = `
</TablePfProvider>
<PaginationWrapper
itemCount={2}
onChange={[Function]}
pagination={
Object {
"page": 1,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

exports[`RedHatRepositories page should render <PermissionDenied /> when permissions are missing 1`] = `
<PermissionDenied
backHref="/"
missingPermissions={
Array [
"view_organizations",
]
}
texts={
Object {
"notAuthorizedMsg": "You are not authorized to perform this action.",
"permissionDeniedMsg": "Permission denied",
"pleaseRequestMsg": "Please request one of the required permissions listed below from a Foreman administrator:",
}
}
/>
`;

Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`manage manifest modal should render 1`] = `
<ForemanModal
<ConnectedForemanModal
id="manageManifestModal"
title="Manage Manifest"
>
Expand Down Expand Up @@ -83,6 +83,7 @@ exports[`manage manifest modal should render 1`] = `
"header": "There is no Manifest History to display.",
}
}
onPaginationChange={[Function]}
rows={
Array [
Object {
Expand Down Expand Up @@ -141,7 +142,7 @@ exports[`manage manifest modal should render 1`] = `
</LoadingState>
</Tab>
</Uncontrolled(Tabs)>
<Component>
<ForemanModalFooter>
<Button
active={false}
block={false}
Expand All @@ -152,6 +153,6 @@ exports[`manage manifest modal should render 1`] = `
>
Close
</Button>
</Component>
</ForemanModal>
</ForemanModalFooter>
</ConnectedForemanModal>
`;
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ Array [
"type": "SUBSCRIPTIONS_RESET_TASKS",
},
Object {
"interval": 1000,
"interval": 5000,
"key": "SUBSCRIPTIONS_TASK_SEARCH",
"params": Object {
"search": "organization_id=1 and result=pending and label=Actions::Katello::Organization::ManifestImport or Actions::Katello::Organization::ManifestRefresh or Actions::Katello::Organization::ManifestDelete or Actions::Katello::UpstreamSubscriptions::BindEntitlements or Actions::Katello::UpstreamSubscriptions::UpdateEntitlement or Actions::Katello::UpstreamSubscriptions::RemoveEntitlements or Actions::Katello::UpstreamSubscriptions::UpdateEntitlements",
Expand All @@ -82,7 +82,7 @@ Array [
"type": "STOP_INTERVAL",
},
Object {
"interval": 1000,
"interval": 5000,
"key": "SUBSCRIPTIONS_POLL_TASK",
"type": "API_GET",
"url": "/foreman_tasks/api/tasks/eb1b6271-8a69-4d98-84fc-bea06ddcc166",
Expand All @@ -92,7 +92,7 @@ Array [

exports[`subscription actions pollTasks can search tasks 1`] = `
Object {
"interval": 1000,
"interval": 5000,
"key": "SUBSCRIPTIONS_TASK_SEARCH",
"params": Object {
"search": "organization_id=1 and result=pending and label=Actions::Katello::Organization::ManifestImport or Actions::Katello::Organization::ManifestRefresh or Actions::Katello::Organization::ManifestDelete or Actions::Katello::UpstreamSubscriptions::BindEntitlements or Actions::Katello::UpstreamSubscriptions::UpdateEntitlement or Actions::Katello::UpstreamSubscriptions::RemoveEntitlements or Actions::Katello::UpstreamSubscriptions::UpdateEntitlements",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,19 @@

exports[`subscriptions page should render <PermissionDenied /> when permissions are missing 1`] = `
<PermissionDenied
backHref="/"
missingPermissions={
Array [
"view_subscriptions",
]
}
texts={
Object {
"notAuthorizedMsg": "You are not authorized to perform this action.",
"permissionDeniedMsg": "Permission denied",
"pleaseRequestMsg": "Please request one of the required permissions listed below from a Foreman administrator:",
}
}
/>
`;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,6 +53,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar 1`] = `
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Manage Manifest
</Button>
Expand All @@ -62,6 +63,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar 1`] = `
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Export CSV
</Button>
Expand Down Expand Up @@ -125,6 +127,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled add but
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Manage Manifest
</Button>
Expand All @@ -134,6 +137,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled add but
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Export CSV
</Button>
Expand Down Expand Up @@ -197,6 +201,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled delete
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Manage Manifest
</Button>
Expand All @@ -206,6 +211,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled delete
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Export CSV
</Button>
Expand Down Expand Up @@ -269,6 +275,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled manifes
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Manage Manifest
</Button>
Expand All @@ -278,6 +285,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with disabled manifes
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Export CSV
</Button>
Expand Down Expand Up @@ -359,6 +367,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with table columns 1`
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Manage Manifest
</Button>
Expand All @@ -368,6 +377,7 @@ exports[`SubscriptionsToolbar renders SubscriptionsToolbar with table columns 1`
bsClass="btn"
bsStyle="default"
disabled={false}
onClick={[Function]}
>
Export CSV
</Button>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

exports[`task actions can poll a task 1`] = `
Object {
"interval": 1000,
"interval": 5000,
"key": "TEST_POLL_TASK",
"type": "API_GET",
"url": "/foreman_tasks/api/tasks/12345",
Expand All @@ -11,7 +11,7 @@ Object {

exports[`task actions can search tasks 1`] = `
Object {
"interval": 1000,
"interval": 5000,
"key": "TEST_TASK_SEARCH",
"params": Object {
"search": "",
Expand Down
3 changes: 3 additions & 0 deletions webpack/test_setup.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,3 +12,6 @@ configure({ adapter: new Adapter() });
// Mocking translation function
global.__ = text => text; // eslint-disable-line
Services.orgId = () => 1;

// Mocking locales to prevent unnecessary fallback messages
window.locales = { en: { domain: 'app', locale_data: { app: { '': {} } } } };

0 comments on commit 8600695

Please sign in to comment.