diff options
Diffstat (limited to 'server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts')
-rw-r--r-- | server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts b/server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts index fa6847c1382..af60faa5205 100644 --- a/server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts +++ b/server/sonar-web/src/main/js/api/mocks/BranchesServiceMock.ts @@ -32,7 +32,7 @@ import { jest.mock('../branches'); const defaultBranches: Branch[] = [ - mockBranch({ isMain: true, name: 'master', status: { qualityGateStatus: 'OK' } }), + mockBranch({ isMain: true, name: 'main', status: { qualityGateStatus: 'OK' } }), mockBranch({ excludedFromPurge: false, name: 'delete-branch', @@ -113,10 +113,19 @@ export default class BranchesServiceMock { this.branches = []; }; + emptyBranchesAndPullRequest = () => { + this.branches = []; + this.pullRequests = []; + }; + addBranch = (branch: Branch) => { this.branches.push(branch); }; + addPullRequest = (branch: PullRequest) => { + this.pullRequests.push(branch); + }; + reset = () => { this.branches = cloneDeep(defaultBranches); this.pullRequests = cloneDeep(defaultPullRequests); |