Skip to content

Commit

Permalink
fixup! Add integration tests for checkout/new branch with autostash
Browse files Browse the repository at this point in the history
Add assertions for modified file
  • Loading branch information
stefanhaller committed Sep 3, 2024
1 parent 4c4c655 commit 9eb2a4f
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
10 changes: 10 additions & 0 deletions pkg/integration/tests/branch/checkout_autostash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ var CheckoutAutostash = NewIntegrationTest(NewIntegrationTestArgs{
shell.UpdateFile("file", "b\n\nb")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
Lines(
Contains("file"),
)

t.Views().Branches().
Focus().
Lines(
Expand All @@ -40,5 +45,10 @@ var CheckoutAutostash = NewIntegrationTest(NewIntegrationTestArgs{
)

t.Git().CurrentBranchName("master")

t.Views().Files().
Lines(
Contains("file"),
)
},
})
10 changes: 10 additions & 0 deletions pkg/integration/tests/branch/new_branch_autostash.go
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,11 @@ var NewBranchAutostash = NewIntegrationTest(NewIntegrationTestArgs{
shell.UpdateFile("file", "b\n\nb")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
t.Views().Files().
Lines(
Contains("file"),
)

t.Views().Branches().
Focus().
Lines(
Expand All @@ -46,5 +51,10 @@ var NewBranchAutostash = NewIntegrationTest(NewIntegrationTestArgs{
)

t.Git().CurrentBranchName("new-branch")

t.Views().Files().
Lines(
Contains("file"),
)
},
})

0 comments on commit 9eb2a4f

Please sign in to comment.