mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-10-05 21:46:49 -04:00
When running the demos at a hight of 35, as the new recording mechanism will, this demo failed because the commits list was too small to show both commits at the same time, and NavigateToLine has a bug that prevents it from finding it by going to the top and pressing down until it matches. We are going to fix that bug in the next commit for similar future situations, but we also solve the problem here by setting the side panels to accordion mode so that more commits are visible; this looks better for this demo anyway.
46 lines
1.2 KiB
Go
46 lines
1.2 KiB
Go
package demo
|
|
|
|
import (
|
|
"github.com/jesseduffield/lazygit/pkg/config"
|
|
. "github.com/jesseduffield/lazygit/pkg/integration/components"
|
|
)
|
|
|
|
var DiffCommits = NewIntegrationTest(NewIntegrationTestArgs{
|
|
Description: "Diff two commits",
|
|
ExtraCmdArgs: []string{},
|
|
Skip: false,
|
|
IsDemo: true,
|
|
SetupConfig: func(config *config.AppConfig) {
|
|
setDefaultDemoConfig(config)
|
|
|
|
config.GetUserConfig().Gui.ShowFileTree = false
|
|
config.GetUserConfig().Gui.ShowCommandLog = false
|
|
config.GetUserConfig().Gui.ExpandFocusedSidePanel = true
|
|
},
|
|
SetupRepo: func(shell *Shell) {
|
|
shell.CreateNCommitsWithRandomMessages(50)
|
|
},
|
|
Run: func(t *TestDriver, keys config.KeybindingConfig) {
|
|
t.SetCaptionPrefix("Compare two commits")
|
|
t.Wait(1000)
|
|
|
|
t.Views().Commits().
|
|
Focus().
|
|
NavigateToLine(Contains("Replace deprecated lifecycle methods in React components")).
|
|
Wait(1000).
|
|
Press(keys.Universal.DiffingMenu).
|
|
Tap(func() {
|
|
t.ExpectPopup().Menu().
|
|
Title(Equals("Diffing")).
|
|
TopLines(
|
|
MatchesRegexp(`Diff .*`),
|
|
).
|
|
Wait(500).
|
|
Confirm()
|
|
}).
|
|
NavigateToLine(Contains("Move constants to a separate config file")).
|
|
Wait(1000).
|
|
PressEnter()
|
|
},
|
|
})
|