diff --git a/tests/ui/job-view/PushList_test.jsx b/tests/ui/job-view/PushList_test.jsx index b8d1132f52c..1f1ab1d9e73 100644 --- a/tests/ui/job-view/PushList_test.jsx +++ b/tests/ui/job-view/PushList_test.jsx @@ -17,6 +17,7 @@ import jobListFixtureOne from '../mock/job_list/job_1'; import jobListFixtureTwo from '../mock/job_list/job_2'; import { configureStore } from '../../../ui/job-view/redux/configureStore'; import PushList from '../../../ui/job-view/pushes/PushList'; +import { fetchPushes } from '../../../ui/job-view/redux/stores/pushes'; import { getApiUrl } from '../../../ui/helpers/url'; import { findJobInstance } from '../../../ui/helpers/job'; @@ -128,6 +129,10 @@ describe('PushList', () => { const testPushList = () => { const store = configureStore(history); + + // Manually trigger fetchPushes since outside testing the App does it. + store.dispatch(fetchPushes()); + return ( diff --git a/ui/job-view/pushes/PushList.jsx b/ui/job-view/pushes/PushList.jsx index b968926ed82..3cb0efd555a 100644 --- a/ui/job-view/pushes/PushList.jsx +++ b/ui/job-view/pushes/PushList.jsx @@ -29,11 +29,6 @@ class PushList extends React.Component { } componentDidMount() { - const { fetchPushes } = this.props; - - // Fetch pushes regardless of whether App started the request, - // the Redux action will handle deduplication if needed. - fetchPushes(); this.poll(); } diff --git a/ui/job-view/redux/stores/pushes.js b/ui/job-view/redux/stores/pushes.js index 6f67c07aeb4..ed120a47171 100644 --- a/ui/job-view/redux/stores/pushes.js +++ b/ui/job-view/redux/stores/pushes.js @@ -248,15 +248,10 @@ export const fetchPushes = ( ) => { return async (dispatch, getState) => { const { - pushes: { pushList, jobMap, oldestPushTimestamp, loadingPushes }, + pushes: { pushList, jobMap, oldestPushTimestamp }, router, } = getState(); - // Prevent duplicate requests when already loading initial data. - if (loadingPushes && !setFromchange) { - return; - } - dispatch({ type: LOADING }); const locationSearch = parseQueryParams(window.location.search);