summaryrefslogtreecommitdiffstats
path: root/pkg
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-08-12 17:17:32 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-08-12 17:24:05 +1000
commit83d642b74f1aada9cc0da5524b6021feb80e5766 (patch)
tree6ab194ea786e912e1b6296d57ec0378fb9bb4da3 /pkg
parentb1bc437d1b91b33c767a31be15f8f41e90c4d8f0 (diff)
Add demo for diffing two commits
Diffstat (limited to 'pkg')
-rw-r--r--pkg/integration/tests/demo/diff_commits.go44
-rw-r--r--pkg/integration/tests/test_list.go1
2 files changed, 45 insertions, 0 deletions
diff --git a/pkg/integration/tests/demo/diff_commits.go b/pkg/integration/tests/demo/diff_commits.go
new file mode 100644
index 000000000..da83564a7
--- /dev/null
+++ b/pkg/integration/tests/demo/diff_commits.go
@@ -0,0 +1,44 @@
+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.UserConfig.Gui.ShowFileTree = false
+ config.UserConfig.Gui.ShowCommandLog = false
+ },
+ 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()
+ },
+})
diff --git a/pkg/integration/tests/test_list.go b/pkg/integration/tests/test_list.go
index 44ff22514..a8b22413c 100644
--- a/pkg/integration/tests/test_list.go
+++ b/pkg/integration/tests/test_list.go
@@ -96,6 +96,7 @@ var tests = []*components.IntegrationTest{
demo.CommitGraph,
demo.CustomCommand,
demo.CustomPatch,
+ demo.DiffCommits,
demo.Filter,
demo.InteractiveRebase,
demo.NukeWorkingTree,