mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-18 10:02:15 +03:00
At the same time, we change the defaults for both of them to "date" (they were "recency" and "alphabetical", respectively, before). This is the reason we need to touch so many integration tests. For some of them I decided to adapt the test assertions to the changed sort order; for others, I added a SetupConfig step to set the order back to "recency" so that I don't have to change what the test does (e.g. how many SelectNextItem() calls are needed to get to a certain branch).
43 lines
1.1 KiB
Go
43 lines
1.1 KiB
Go
package custom_commands
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
"github.com/jesseduffield/lazygit/pkg/integration/tests/shared"
|
|
)
|
|
|
|
var CheckForConflicts = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Run a command and check for conflicts after",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
SetupRepo: func(shell *Shell) {
|
|
shared.MergeConflictsSetup(shell)
|
|
},
|
|
SetupConfig: func(cfg *config.AppConfig) {
|
|
cfg.GetUserConfig().CustomCommands = []config.CustomCommand{
|
|
{
|
|
Key: "m",
|
|
Context: "localBranches",
|
|
Command: "git merge {{ .SelectedLocalBranch.Name | quote }}",
|
|
After: &config.CustomCommandAfterHook{
|
|
CheckForConflicts: true,
|
|
},
|
|
},
|
|
}
|
|
|
|
cfg.GetUserConfig().Git.LocalBranchSortOrder = "recency"
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.Views().Branches().
|
|
Focus().
|
|
TopLines(
|
|
Contains("first-change-branch"),
|
|
Contains("second-change-branch"),
|
|
).
|
|
NavigateToLine(Contains("second-change-branch")).
|
|
Press("m")
|
|
|
|
t.Common().AcknowledgeConflicts()
|
|
},
|
|
})
|