Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions tests/ui/job-view/PushList_test.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';

Expand Down Expand Up @@ -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 (
<Provider store={store} context={ReactReduxContext}>
<ConnectedRouter history={history} context={ReactReduxContext}>
Expand Down
5 changes: 0 additions & 5 deletions ui/job-view/pushes/PushList.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down
7 changes: 1 addition & 6 deletions ui/job-view/redux/stores/pushes.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down