✨ feat(vscode): 跳定义、点链接、编辑切回预览不改开着的预览对比什么
This commit is contained in:
1 parent
d4416e7b26
commit
ce5327dcd5
8 files changed
+239
-47
No files matched your search
@@ -218,7 +218,28 @@ describe('预览对比什么看这个标签页是从哪儿打开的', () => {
|
||||
await vi.waitFor(() => expect(page.posted()).toContainEqual(comparedWithHead))
|
||||
})
|
||||
|
||||
it('开着的预览再从别处点开就不比,再从「未提交的更改」点开又比;只切标签页不变', async () => {
|
||||
it('跳定义、点链接打到开着的预览不改它对比什么、只滚过去;要新开的预览不比', async () => {
|
||||
const { provider, document, diffBase } = opening()
|
||||
const page = tab()
|
||||
await provider.open(document.uri as never, { from: 'uncommitted' }, async () => provider.resolveCustomTextEditor(document as never, page.panel))
|
||||
await page.send({ type: 'ready' })
|
||||
await vi.waitFor(() => expect(page.posted()).toContainEqual(comparedWithHead))
|
||||
|
||||
page.clear()
|
||||
await provider.open(document.uri as never, { reveal: { line: 1 } }, async () => {})
|
||||
expect(page.posted()).toEqual([{ type: 'reveal', line: 1 }])
|
||||
expect(provider.openedFrom(document.uri as never)).toBe('uncommitted')
|
||||
|
||||
diffBase.mockClear()
|
||||
const fresh = tab()
|
||||
await provider.open(document.uri as never, { reveal: { line: 1 } }, async () => provider.resolveCustomTextEditor(document as never, fresh.panel))
|
||||
await fresh.send({ type: 'ready' })
|
||||
expect(fresh.posted()).toContainEqual({ type: 'openedFrom', from: 'other' })
|
||||
expect(diffBase).toHaveBeenCalledWith(document.uri, 'other')
|
||||
expect(diffBase).not.toHaveBeenCalledWith(document.uri, 'uncommitted')
|
||||
})
|
||||
|
||||
it('开着的预览再从主栏点开就不比,再从「未提交的更改」点开又比;只切标签页不变', async () => {
|
||||
const { provider, document } = opening()
|
||||
const page = tab()
|
||||
await provider.open(document.uri as never, { from: 'uncommitted' }, async () => provider.resolveCustomTextEditor(document as never, page.panel))
|
||||
|
||||
Reference in new issue
Block a user