This repository has been archived by the owner on Sep 5, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 42
[#740] Waiting for available conversion hosts #807
Merged
mturley
merged 5 commits into
ManageIQ:master
from
michaelkro:740-waiting-for-conversion-hosts
Nov 28, 2018
Merged
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,12 @@ | ||
import configureMockStore from 'redux-mock-store'; | ||
import thunk from 'redux-thunk'; | ||
import promiseMiddleware from 'redux-promise-middleware'; | ||
import { mockRequest, mockReset } from '../../../../../common/mockRequests'; | ||
|
||
import { fetchTransformationPlansAction, setMigrationsFilterAction } from '../OverviewActions'; | ||
import { mockRequest, mockReset } from '../../../../../common/mockRequests'; | ||
import { fetchTransformationPlansAction, setMigrationsFilterAction, cancelPlanRequestAction } from '../OverviewActions'; | ||
import { requestTransformationPlansData } from '../overview.transformationPlans.fixtures'; | ||
import { cancelRequestResponse } from '../overview.cancelRequest.fixtures'; | ||
import { TRANSFORMATION_PLAN_REQUESTS_URL } from '../OverviewConstants'; | ||
|
||
const middlewares = [thunk, promiseMiddleware()]; | ||
const mockStore = configureMockStore(middlewares); | ||
|
@@ -78,3 +80,35 @@ describe('setMigrationsFilterAction', () => { | |
expect(store.getActions()).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
describe('cancelPlanRequestAction', () => { | ||
const request = { | ||
method: 'POST', | ||
data: { action: 'cancel' } | ||
}; | ||
|
||
const action = cancelPlanRequestAction(TRANSFORMATION_PLAN_REQUESTS_URL, '1'); | ||
|
||
test('dispatches PENDING and FULFILLED actions', () => { | ||
mockRequest({ | ||
...request, | ||
status: 200, | ||
response: { data: cancelRequestResponse } | ||
}); | ||
|
||
return store.dispatch(action).then(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 2 locations. Consider refactoring. |
||
expect(store.getActions()).toMatchSnapshot(); | ||
}); | ||
}); | ||
|
||
test('dispatched PENDING and REJECTED actions', () => { | ||
mockRequest({ | ||
...request, | ||
status: 404 | ||
}); | ||
|
||
return store.dispatch(action).catch(() => { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 2 locations. Consider refactoring. |
||
expect(store.getActions()).toMatchSnapshot(); | ||
}); | ||
}); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
12 changes: 12 additions & 0 deletions
12
...javascript/react/screens/App/Overview/__test__/__snapshots__/OverviewActions.test.js.snap
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
22 changes: 22 additions & 0 deletions
22
app/javascript/react/screens/App/Overview/components/Migrations/CardEmptyState.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
import React from 'react'; | ||
import PropTypes from 'prop-types'; | ||
import { EmptyState, Spinner } from 'patternfly-react'; | ||
|
||
const CardEmptyState = ({ iconType, iconName, emptyStateInfo, emptyStateInfoStyles, showSpinner, spinnerStyles }) => ( | ||
<EmptyState> | ||
{showSpinner && <Spinner loading size="lg" style={spinnerStyles} />} | ||
{iconType && iconName && <EmptyState.Icon type={iconType} name={iconName} />} | ||
{emptyStateInfo && <EmptyState.Info style={emptyStateInfoStyles}>{emptyStateInfo}</EmptyState.Info>} | ||
</EmptyState> | ||
); | ||
|
||
CardEmptyState.propTypes = { | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Similar blocks of code found in 11 locations. Consider refactoring. |
||
emptyStateInfo: PropTypes.node, | ||
emptyStateInfoStyles: PropTypes.object, | ||
iconName: PropTypes.string, | ||
iconType: PropTypes.string, | ||
showSpinner: PropTypes.bool, | ||
spinnerStyles: PropTypes.object | ||
}; | ||
|
||
export default CardEmptyState; |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Avoid too many
return
statements within this function.