diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2019-07-17 09:40:55 +0200 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-08-02 20:21:14 +0200 |
commit | 87fe29be37cc59cc3cfc4d4a9c9f2939f488ab71 (patch) | |
tree | bdf9feac09f563c023caafa244ec90b4070ab665 /server/sonar-web/src/main/js/store | |
parent | 50f8e916bdfdaa372fc4f0c3bd3feb26077b3588 (diff) | |
download | sonarqube-87fe29be37cc59cc3cfc4d4a9c9f2939f488ab71.tar.gz sonarqube-87fe29be37cc59cc3cfc4d4a9c9f2939f488ab71.zip |
SONAR-12292 Do not debounce the fetchBranchStatus root action
Diffstat (limited to 'server/sonar-web/src/main/js/store')
-rw-r--r-- | server/sonar-web/src/main/js/store/__tests__/rootActions-test.tsx | 4 | ||||
-rw-r--r-- | server/sonar-web/src/main/js/store/rootActions.ts | 5 |
2 files changed, 2 insertions, 7 deletions
diff --git a/server/sonar-web/src/main/js/store/__tests__/rootActions-test.tsx b/server/sonar-web/src/main/js/store/__tests__/rootActions-test.tsx index 4828f7559f0..d4f9c887b64 100644 --- a/server/sonar-web/src/main/js/store/__tests__/rootActions-test.tsx +++ b/server/sonar-web/src/main/js/store/__tests__/rootActions-test.tsx @@ -21,8 +21,6 @@ import { mockLongLivingBranch, mockQualityGateStatusCondition } from '../../help import { registerBranchStatusAction } from '../branches'; import { fetchBranchStatus, registerBranchStatus } from '../rootActions'; -jest.useFakeTimers(); - jest.mock('../branches', () => ({ ...require.requireActual('../branches'), registerBranchStatusAction: jest.fn() @@ -65,8 +63,6 @@ describe('branch store actions', () => { const dispatch = jest.fn(); fetchBranchStatus(branchLike, component)(dispatch); - - jest.runAllTimers(); await new Promise(setImmediate); expect(registerBranchStatusAction).toBeCalledWith( diff --git a/server/sonar-web/src/main/js/store/rootActions.ts b/server/sonar-web/src/main/js/store/rootActions.ts index f7ffb9022cb..f77391118cb 100644 --- a/server/sonar-web/src/main/js/store/rootActions.ts +++ b/server/sonar-web/src/main/js/store/rootActions.ts @@ -17,7 +17,6 @@ * along with this program; if not, write to the Free Software Foundation, * Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. */ -import { debounce } from 'lodash'; import { InjectedRouter } from 'react-router'; import { Dispatch } from 'redux'; import * as auth from '../api/auth'; @@ -67,7 +66,7 @@ export const fetchOrganization = (key: string) => (dispatch: Dispatch) => { }; export function fetchBranchStatus(branchLike: T.BranchLike, projectKey: string) { - return debounce((dispatch: Dispatch<any>) => { + return (dispatch: Dispatch<any>) => { getQualityGateProjectStatus({ projectKey, ...getBranchLikeQuery(branchLike) }).then( projectStatus => { const { ignoredConditions, status } = projectStatus; @@ -80,7 +79,7 @@ export function fetchBranchStatus(branchLike: T.BranchLike, projectKey: string) dispatch(addGlobalErrorMessage('Fetching Quality Gate status failed')); } ); - }, 1000); + }; } export function doLogin(login: string, password: string) { |