Skip to content

Commit

Permalink
fixed breaking spec
Browse files Browse the repository at this point in the history
  • Loading branch information
srzainab committed Feb 15, 2024
1 parent 3f3a385 commit f514c47
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions src/pullRequestQuickActions/pullRequestQuickActions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@ describe('Pull Request Quick Actions', () => {
})

it('adds assignee to pull request', async () => {
mockSpaceUsers.SpaceUsers.get.mockReturnValue([])
await subject().addAssignee({
codeReview: mockModel,
context: mockModel,
Expand All @@ -49,13 +50,15 @@ describe('Pull Request Quick Actions', () => {
context: mockModel,
placeholder: 'Select a user',
title: 'Add assignee to pull request',
spaceUsers: [],
})
)
expect(mockPresence.Presence.set).toBeCalled()
expect(mockPullRequestState.PullRequestState.updateWithDelay).toBeCalled()
})

it('adds reviewer on pull request', async () => {
mockSpaceUsers.SpaceUsers.get.mockReturnValue([])
await subject().requestReview({
codeReview: mockModel,
context: mockModel,
Expand All @@ -66,6 +69,7 @@ describe('Pull Request Quick Actions', () => {
context: mockModel,
placeholder: 'Select a user',
title: 'Add reviewer to pull request',
spaceUsers: [],
})
)
expect(mockPresence.Presence.set).toBeCalled()
Expand All @@ -84,6 +88,7 @@ const subject = () => {
jest.mock('../utils/pullRequestsState', () => mockPullRequestState)
jest.mock('../views/quickpicks/spaceUserPicker', () => mockSpaceUserPicker)
jest.mock('../views/quickpicks/timePicker', () => mockTimerPicker)
jest.mock('../models/spaceUsers', () => mockSpaceUsers)
return require('./pullRequestQuickActions').PullRequestQuickActions
}

Expand All @@ -109,6 +114,11 @@ const mockPullRequestState = {
updateWithDelay: jest.fn(),
},
}
const mockSpaceUsers = {
SpaceUsers: {
get: jest.fn(),
},
}
const mockSpaceUserPicker = {
spaceUserPicker: jest.fn(),
}
Expand Down

0 comments on commit f514c47

Please sign in to comment.