mirror of
https://github.com/stablyai/orca.git
synced 2026-10-01 08:01:56 +00:00
add active modified-pane test
This commit is contained in:
@@ -93,6 +93,22 @@ describe('installDiffEditorShiftWheelScroll', () => {
|
||||
dispose()
|
||||
})
|
||||
|
||||
it('scrolls the modified pane independently', () => {
|
||||
const original = createPaneFixture()
|
||||
const modified = createPaneFixture()
|
||||
const dispose = installDiffEditorShiftWheelScroll({
|
||||
getOriginalEditor: () => original,
|
||||
getModifiedEditor: () => modified
|
||||
})
|
||||
|
||||
const event = dispatchWheel(modified.input, { deltaY: 24, shiftKey: true })
|
||||
|
||||
expect(event.defaultPrevented).toBe(true)
|
||||
expect(modified.setScrollLeft).toHaveBeenCalledWith(34)
|
||||
expect(original.setScrollLeft).not.toHaveBeenCalled()
|
||||
dispose()
|
||||
})
|
||||
|
||||
it('removes both pane listeners when disposed', () => {
|
||||
const original = createPaneFixture()
|
||||
const modified = createPaneFixture()
|
||||
|
||||
Reference in New Issue
Block a user