mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-08-07 22:02:56 +03:00
Add tests for moving a commit across an update-ref todo
This works correctly, we just didn't have test coverage for it.
This commit is contained in:
@@ -64,6 +64,21 @@ func TestRebaseCommands_moveTodoDown(t *testing.T) {
|
|||||||
{Command: todo.Pick, Commit: "5678"},
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testName: "move across update-ref todo",
|
||||||
|
todos: []todo.Todo{
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
},
|
||||||
|
todoToMoveDown: Todo{Hash: "5678"},
|
||||||
|
expectedErr: "",
|
||||||
|
expectedTodos: []todo.Todo{
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testName: "skip an invisible todo",
|
testName: "skip an invisible todo",
|
||||||
todos: []todo.Todo{
|
todos: []todo.Todo{
|
||||||
@@ -190,6 +205,21 @@ func TestRebaseCommands_moveTodoUp(t *testing.T) {
|
|||||||
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
{
|
||||||
|
testName: "move across update-ref todo",
|
||||||
|
todos: []todo.Todo{
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
},
|
||||||
|
todoToMoveUp: Todo{Hash: "1234"},
|
||||||
|
expectedErr: "",
|
||||||
|
expectedTodos: []todo.Todo{
|
||||||
|
{Command: todo.UpdateRef, Ref: "refs/heads/some_branch"},
|
||||||
|
{Command: todo.Pick, Commit: "1234"},
|
||||||
|
{Command: todo.Pick, Commit: "5678"},
|
||||||
|
},
|
||||||
|
},
|
||||||
{
|
{
|
||||||
testName: "skip an invisible todo",
|
testName: "skip an invisible todo",
|
||||||
todos: []todo.Todo{
|
todos: []todo.Todo{
|
||||||
|
Reference in New Issue
Block a user