Merge pull request #18906 from rafeca/fix-git-diff-test

Fix git-diff package test
This commit is contained in:
Rafael Oleza
2019-02-25 16:30:28 +01:00
committed by GitHub
20 changed files with 15 additions and 16 deletions

View File

@@ -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])
})
})

View File

@@ -1 +0,0 @@
745ed7547d15a61bc4ee7e182615590f44aca201 refs/heads/master

View File

@@ -0,0 +1,3 @@
xťÍM0†a×=Ĺ\@ŇB;SbtíŇ ĄŐ
őçřbL<€Ëç]|źJi6yöŇJ×-µ•eÉ5•NŁ1d‰‡€®žP
ľçË4ĂŃ?â'~F×Ghú—ŻöçÄq(Ü”v *«L‰<4C>¶’¤k]ł˙AşN·Á×xü)ż˛xmđCŰ

View File

@@ -1,2 +0,0 @@
P pack-fb30b46ead026befe94c88f5591a6d3dfdca4e95.pack

View File

@@ -1,2 +0,0 @@
# pack-refs with: peeled fully-peeled sorted
745ed7547d15a61bc4ee7e182615590f44aca201 refs/heads/master

View File

@@ -0,0 +1 @@
065a272b55ec2ee84530dffd60b6869f7bf5d99c

View File

@@ -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])