summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/demo/nuke_working_tree.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2023-08-01 16:57:37 +1000
committerJesse Duffield <jessedduffield@gmail.com>2023-08-01 22:16:04 +1000
commita200fccba95a0a85a028bb106836f8537526c71a (patch)
tree5c09ba703772aef6f04f196a42d5554150f9ab58 /pkg/integration/tests/demo/nuke_working_tree.go
parent37dc31b81541193e7eb10371e2b19c705065dc16 (diff)
Add explosion animation when nuking working tree
I've been thinking about this for a while: I think it looks really cool if nuking your working tree actually results in a nuke animation. So I've added an opt-out config for it
Diffstat (limited to 'pkg/integration/tests/demo/nuke_working_tree.go')
-rw-r--r--pkg/integration/tests/demo/nuke_working_tree.go45
1 files changed, 45 insertions, 0 deletions
diff --git a/pkg/integration/tests/demo/nuke_working_tree.go b/pkg/integration/tests/demo/nuke_working_tree.go
new file mode 100644
index 000000000..d69b06879
--- /dev/null
+++ b/pkg/integration/tests/demo/nuke_working_tree.go
@@ -0,0 +1,45 @@
+package demo
+
+import (
+ "github.com/jesseduffield/lazygit/pkg/config"
+ . "github.com/jesseduffield/lazygit/pkg/integration/components"
+)
+
+var NukeWorkingTree = NewIntegrationTest(NewIntegrationTestArgs{
+ Description: "Nuke the working tree",
+ ExtraCmdArgs: []string{"status"},
+ Skip: false,
+ IsDemo: true,
+ SetupConfig: func(config *config.AppConfig) {
+ // No idea why I had to use version 2: it should be using my own computer's
+ // font and the one iterm uses is version 3.
+ config.UserConfig.Gui.NerdFontsVersion = "2"
+ config.UserConfig.Gui.AnimateExplosion = true
+ },
+ SetupRepo: func(shell *Shell) {
+ shell.EmptyCommit("blah")
+ shell.CreateFile("controllers/red_controller.rb", "")
+ shell.CreateFile("controllers/green_controller.rb", "")
+ shell.CreateFileAndAdd("controllers/blue_controller.rb", "")
+ shell.CreateFile("controllers/README.md", "")
+ shell.CreateFileAndAdd("views/helpers/list.rb", "")
+ shell.CreateFile("views/helpers/sort.rb", "")
+ shell.CreateFileAndAdd("views/users_view.rb", "")
+ },
+ Run: func(t *TestDriver, keys config.KeybindingConfig) {
+ t.SetCaptionPrefix("Nuke the working tree")
+
+ t.Views().Files().
+ IsFocused().
+ Wait(1000).
+ Press(keys.Files.ViewResetOptions).
+ Tap(func() {
+ t.Wait(1000)
+
+ t.ExpectPopup().Menu().
+ Title(Equals("")).
+ Select(Contains("Nuke working tree")).
+ Confirm()
+ })
+ },
+})