🐛 fix(vscode): 加载看板不再替别人补列评论
This commit is contained in:
1 parent
37291db9bb
commit
b88f0838df
2 files changed
+6
-20
No files matched your search
@@ -134,12 +134,10 @@ describe('loadIssues', () => {
|
||||
expect(issues[0].column).toBe('todo')
|
||||
})
|
||||
|
||||
it('缺 state 评论时 POST 不挡住返回', async () => {
|
||||
it('缺 state 评论时用默认列,不代别人发评论', async () => {
|
||||
const { loadIssues } = await import('./issueLoader.js')
|
||||
listIssuesByFilter.mockResolvedValue([issue(3, { comments: 0 })])
|
||||
postIssueComment.mockReturnValue(new Promise(() => {}))
|
||||
listIssuesByFilter.mockResolvedValue([issue(3, { comments: 0, user: { login: 'cruldra' } })])
|
||||
|
||||
const started = Date.now()
|
||||
const { issues } = await loadIssues({
|
||||
host: 'gitea.example',
|
||||
token: 't',
|
||||
@@ -147,8 +145,7 @@ describe('loadIssues', () => {
|
||||
repo: 'r',
|
||||
scope: 'all',
|
||||
})
|
||||
expect(Date.now() - started).toBeLessThan(500)
|
||||
expect(issues[0].column).toBe('todo')
|
||||
expect(postIssueComment).toHaveBeenCalled()
|
||||
expect(postIssueComment).not.toHaveBeenCalled()
|
||||
})
|
||||
})
|
||||
Reference in new issue
Block a user