mirror of
https://github.com/atom/atom.git
synced 2026-01-26 23:38:48 -05:00
Merge pull request #18906 from rafeca/fix-git-diff-test
Fix git-diff package test
This commit is contained in:
@@ -22,7 +22,7 @@ describe('git-diff:toggle-diff-list', () => {
|
||||
|
||||
runs(() => {
|
||||
editor = atom.workspace.getActiveTextEditor()
|
||||
editor.setCursorBufferPosition([3, 28])
|
||||
editor.setCursorBufferPosition([8, 30])
|
||||
editor.insertText('a')
|
||||
atom.commands.dispatch(editor.getElement(), 'git-diff:toggle-diff-list')
|
||||
})
|
||||
@@ -35,7 +35,7 @@ describe('git-diff:toggle-diff-list', () => {
|
||||
|
||||
it('shows a list of all diff hunks', () => {
|
||||
diffListView = document.querySelector('.diff-list-view ol')
|
||||
expect(diffListView.textContent).toBe('var pivot = items.shift(a)-4,1 +4,1')
|
||||
expect(diffListView.textContent).toBe('while (items.length > 0) {a-9,1 +9,1')
|
||||
})
|
||||
|
||||
it('moves the cursor to the selected hunk', () => {
|
||||
@@ -44,6 +44,6 @@ describe('git-diff:toggle-diff-list', () => {
|
||||
document.querySelector('.diff-list-view'),
|
||||
'core:confirm'
|
||||
)
|
||||
expect(editor.getCursorBufferPosition()).toEqual([3, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
})
|
||||
})
|
||||
|
||||
Binary file not shown.
@@ -1 +0,0 @@
|
||||
745ed7547d15a61bc4ee7e182615590f44aca201 refs/heads/master
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
||||
xťÍM‚0†a×=Ĺ\@ŇB;SbtíŇĄŐ
|
||||
őçřbL<€Ëç]|ź›RŠJi6yö‚ŇJ×-µ•eÉ5•NŁ1d‰‡€®žP
|
||||
ľçË4ĂŃ?â'~F×Ghú—ŻöçÄq(Ü”v *«L‰<4C>¶’¤k]ł˙AşN·Á×xü)ż˛xmđCŰ
|
||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
P pack-fb30b46ead026befe94c88f5591a6d3dfdca4e95.pack
|
||||
|
||||
Binary file not shown.
Binary file not shown.
@@ -1,2 +0,0 @@
|
||||
# pack-refs with: peeled fully-peeled sorted
|
||||
745ed7547d15a61bc4ee7e182615590f44aca201 refs/heads/master
|
||||
1
packages/git-diff/spec/fixtures/working-dir/git.git/refs/heads/master
vendored
Normal file
1
packages/git-diff/spec/fixtures/working-dir/git.git/refs/heads/master
vendored
Normal file
@@ -0,0 +1 @@
|
||||
065a272b55ec2ee84530dffd60b6869f7bf5d99c
|
||||
@@ -156,13 +156,13 @@ describe('GitDiff package', () => {
|
||||
describe('move-to-next-diff/move-to-previous-diff events', () => {
|
||||
it('moves the cursor to first character of the next/previous diff line', () => {
|
||||
editor.insertText('a')
|
||||
editor.setCursorBufferPosition([9])
|
||||
editor.setCursorBufferPosition([5])
|
||||
editor.deleteLine()
|
||||
advanceClock(editor.getBuffer().stoppedChangingDelay)
|
||||
|
||||
editor.setCursorBufferPosition([0])
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-next-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([4, 4])
|
||||
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-previous-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([0, 0])
|
||||
@@ -170,19 +170,19 @@ describe('GitDiff package', () => {
|
||||
|
||||
it('wraps around to the first/last diff in the file', () => {
|
||||
editor.insertText('a')
|
||||
editor.setCursorBufferPosition([9])
|
||||
editor.setCursorBufferPosition([5])
|
||||
editor.deleteLine()
|
||||
advanceClock(editor.getBuffer().stoppedChangingDelay)
|
||||
|
||||
editor.setCursorBufferPosition([0])
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-next-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([4, 4])
|
||||
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-next-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([0, 0])
|
||||
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-previous-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([4, 4])
|
||||
})
|
||||
|
||||
describe('when the wrapAroundOnMoveToDiff config option is false', () => {
|
||||
@@ -192,16 +192,16 @@ describe('GitDiff package', () => {
|
||||
|
||||
it('does not wraps around to the first/last diff in the file', () => {
|
||||
editor.insertText('a')
|
||||
editor.setCursorBufferPosition([9])
|
||||
editor.setCursorBufferPosition([5])
|
||||
editor.deleteLine()
|
||||
advanceClock(editor.getBuffer().stoppedChangingDelay)
|
||||
|
||||
editor.setCursorBufferPosition([0])
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-next-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([4, 4])
|
||||
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-next-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([8, 4])
|
||||
expect(editor.getCursorBufferPosition()).toEqual([4, 4])
|
||||
|
||||
atom.commands.dispatch(editorElement, 'git-diff:move-to-previous-diff')
|
||||
expect(editor.getCursorBufferPosition()).toEqual([0, 0])
|
||||
|
||||
Reference in New Issue
Block a user