diff options
author | Wouter Admiraal <wouter.admiraal@sonarsource.com> | 2018-12-19 15:28:21 +0100 |
---|---|---|
committer | SonarTech <sonartech@sonarsource.com> | 2019-01-18 20:21:02 +0100 |
commit | 5c110414621fcfb2db1083f76ff09c4b6364757f (patch) | |
tree | e4093ebbf1a8402f4e60c4c1eb8839b2a70a5f4a /server/sonar-web/src/main/js/helpers/testUtils.ts | |
parent | 0d3ba8c8aa4c29e46e9a687f42590ffda3fb348f (diff) | |
download | sonarqube-5c110414621fcfb2db1083f76ff09c4b6364757f.tar.gz sonarqube-5c110414621fcfb2db1083f76ff09c4b6364757f.zip |
SONARCLOUD-329 Create downgrade reason page
Diffstat (limited to 'server/sonar-web/src/main/js/helpers/testUtils.ts')
-rw-r--r-- | server/sonar-web/src/main/js/helpers/testUtils.ts | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/server/sonar-web/src/main/js/helpers/testUtils.ts b/server/sonar-web/src/main/js/helpers/testUtils.ts index fdf8bf0728b..210bd412192 100644 --- a/server/sonar-web/src/main/js/helpers/testUtils.ts +++ b/server/sonar-web/src/main/js/helpers/testUtils.ts @@ -19,6 +19,7 @@ */ import { ShallowWrapper, ReactWrapper } from 'enzyme'; import { InjectedRouter } from 'react-router'; +import { Location } from 'history'; import { EditionKey } from '../apps/marketplace/utils'; export const mockEvent = { @@ -133,6 +134,18 @@ export async function waitAndUpdate(wrapper: ShallowWrapper<any, any> | ReactWra wrapper.update(); } +export function mockLocation(overrides = {}): Location { + return { + action: 'PUSH', + key: 'key', + pathname: '/path', + query: {}, + search: '', + state: {}, + ...overrides + }; +} + export function mockRouter(overrides: { push?: Function; replace?: Function } = {}) { return { createHref: jest.fn(), |