From 88c76868ba8877bf3a22dcb0c11c12e780e7273d Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 19 Feb 2023 13:59:19 +1100 Subject: [PATCH] migrate initial open test --- pkg/integration/tests/misc/initial_open.go | 24 ++++++++++++++++++ pkg/integration/tests/tests_gen.go | 1 + .../integration/initialOpen/config/config.yml | 0 .../expected/repo/.git_keep/COMMIT_EDITMSG | 1 - .../expected/repo/.git_keep/FETCH_HEAD | 0 .../initialOpen/expected/repo/.git_keep/HEAD | 1 - .../expected/repo/.git_keep/config | 10 -------- .../expected/repo/.git_keep/description | 1 - .../initialOpen/expected/repo/.git_keep/index | Bin 209 -> 0 bytes .../expected/repo/.git_keep/info/exclude | 7 ----- .../expected/repo/.git_keep/logs/HEAD | 2 -- .../repo/.git_keep/logs/refs/heads/master | 2 -- .../0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 | Bin 52 -> 0 bytes .../46/f86259c48ec60496e43d9c962e32f40e7cdefb | Bin 121 -> 0 bytes .../62/b35f5751dd871e0908247223d276b5efeb4cb4 | Bin 57 -> 0 bytes .../a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 | Bin 21 -> 0 bytes .../e4/776798a2a73374b45e6321b60b5578b9fb590c | 2 -- .../expected/repo/.git_keep/refs/heads/master | 1 - .../initialOpen/expected/repo/myfile1 | 1 - .../initialOpen/expected/repo/myfile2 | 1 - test/integration/initialOpen/recording.json | 1 - test/integration/initialOpen/setup.sh | 16 ------------ test/integration/initialOpen/test.json | 1 - 23 files changed, 25 insertions(+), 47 deletions(-) create mode 100644 pkg/integration/tests/misc/initial_open.go delete mode 100644 test/integration/initialOpen/config/config.yml delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/COMMIT_EDITMSG delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/FETCH_HEAD delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/HEAD delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/config delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/description delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/index delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/info/exclude delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/logs/HEAD delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/logs/refs/heads/master delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/objects/46/f86259c48ec60496e43d9c962e32f40e7cdefb delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/objects/62/b35f5751dd871e0908247223d276b5efeb4cb4 delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/objects/a5/bce3fd2565d8f458555a0c6f42d0504a848bd5 delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/objects/e4/776798a2a73374b45e6321b60b5578b9fb590c delete mode 100644 test/integration/initialOpen/expected/repo/.git_keep/refs/heads/master delete mode 100644 test/integration/initialOpen/expected/repo/myfile1 delete mode 100644 test/integration/initialOpen/expected/repo/myfile2 delete mode 100644 test/integration/initialOpen/recording.json delete mode 100644 test/integration/initialOpen/setup.sh delete mode 100644 test/integration/initialOpen/test.json diff --git a/pkg/integration/tests/misc/initial_open.go b/pkg/integration/tests/misc/initial_open.go new file mode 100644 index 000000000..cc4146fc6 --- /dev/null +++ b/pkg/integration/tests/misc/initial_open.go @@ -0,0 +1,24 @@ +package misc + +import ( + "github.com/jesseduffield/lazygit/pkg/config" + . "github.com/jesseduffield/lazygit/pkg/integration/components" +) + +var InitialOpen = NewIntegrationTest(NewIntegrationTestArgs{ + Description: "Confirms a popup appears on first opening Lazygit", + ExtraCmdArgs: "", + Skip: false, + SetupConfig: func(config *config.AppConfig) { + config.UserConfig.DisableStartupPopups = false + }, + SetupRepo: func(shell *Shell) {}, + Run: func(t *TestDriver, keys config.KeybindingConfig) { + t.ExpectPopup().Confirmation(). + Title(Equals("")). + Content(Contains("Thanks for using lazygit!")). + Confirm() + + t.Views().Files().IsFocused() + }, +}) diff --git a/pkg/integration/tests/tests_gen.go b/pkg/integration/tests/tests_gen.go index 495fb16ed..ecd0ced70 100644 --- a/pkg/integration/tests/tests_gen.go +++ b/pkg/integration/tests/tests_gen.go @@ -64,6 +64,7 @@ var tests = []*components.IntegrationTest{ interactive_rebase.AmendMerge, interactive_rebase.One, misc.ConfirmOnQuit, + misc.InitialOpen, patch_building.CopyPatchToClipboard, stash.Rename, stash.Stash, diff --git a/test/integration/initialOpen/config/config.yml b/test/integration/initialOpen/config/config.yml deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/initialOpen/expected/repo/.git_keep/COMMIT_EDITMSG b/test/integration/initialOpen/expected/repo/.git_keep/COMMIT_EDITMSG deleted file mode 100644 index d72af3146..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/COMMIT_EDITMSG +++ /dev/null @@ -1 +0,0 @@ -asd diff --git a/test/integration/initialOpen/expected/repo/.git_keep/FETCH_HEAD b/test/integration/initialOpen/expected/repo/.git_keep/FETCH_HEAD deleted file mode 100644 index e69de29bb..000000000 diff --git a/test/integration/initialOpen/expected/repo/.git_keep/HEAD b/test/integration/initialOpen/expected/repo/.git_keep/HEAD deleted file mode 100644 index cb089cd89..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/HEAD +++ /dev/null @@ -1 +0,0 @@ -ref: refs/heads/master diff --git a/test/integration/initialOpen/expected/repo/.git_keep/config b/test/integration/initialOpen/expected/repo/.git_keep/config deleted file mode 100644 index 8ae104545..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/config +++ /dev/null @@ -1,10 +0,0 @@ -[core] - repositoryformatversion = 0 - filemode = true - bare = false - logallrefupdates = true - ignorecase = true - precomposeunicode = true -[user] - email = CI@example.com - name = CI diff --git a/test/integration/initialOpen/expected/repo/.git_keep/description b/test/integration/initialOpen/expected/repo/.git_keep/description deleted file mode 100644 index 498b267a8..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/description +++ /dev/null @@ -1 +0,0 @@ -Unnamed repository; edit this file 'description' to name the repository. diff --git a/test/integration/initialOpen/expected/repo/.git_keep/index b/test/integration/initialOpen/expected/repo/.git_keep/index deleted file mode 100644 index 825adac84ff3ddb3a0c9f49002a7219cc6669bb0..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 209 zcmZ?q402{*U|<5_gxnPyO_grv!DvPX1{OBMb-4@-jY}997{3D5hyXF$(mjv=s;1uf z5)m53lkapPz^kSEDg%3NWm;xVsv%GTNWWQQIya1ln$tpxIYvNpLV{dffs`bJk%9qN u(&qT^z`N~ooE$1e%9qNvzJKkrCAY4BkpaijHA{uhzHqM&IaVKYb|nCig+`(P diff --git a/test/integration/initialOpen/expected/repo/.git_keep/info/exclude b/test/integration/initialOpen/expected/repo/.git_keep/info/exclude deleted file mode 100644 index 8e9f2071f..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/info/exclude +++ /dev/null @@ -1,7 +0,0 @@ -# git ls-files --others --exclude-from=.git/info/exclude -# Lines that start with '#' are comments. -# For a project mostly in C, the following would be a good set of -# exclude patterns (uncomment them if you want to use them): -# *.[oa] -# *~ -.DS_Store diff --git a/test/integration/initialOpen/expected/repo/.git_keep/logs/HEAD b/test/integration/initialOpen/expected/repo/.git_keep/logs/HEAD deleted file mode 100644 index 9728b11df..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/logs/HEAD +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 46f86259c48ec60496e43d9c962e32f40e7cdefb CI 1617799345 +1000 commit (initial): myfile1 -46f86259c48ec60496e43d9c962e32f40e7cdefb e4776798a2a73374b45e6321b60b5578b9fb590c CI 1617799348 +1000 commit: asd diff --git a/test/integration/initialOpen/expected/repo/.git_keep/logs/refs/heads/master b/test/integration/initialOpen/expected/repo/.git_keep/logs/refs/heads/master deleted file mode 100644 index 9728b11df..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/logs/refs/heads/master +++ /dev/null @@ -1,2 +0,0 @@ -0000000000000000000000000000000000000000 46f86259c48ec60496e43d9c962e32f40e7cdefb CI 1617799345 +1000 commit (initial): myfile1 -46f86259c48ec60496e43d9c962e32f40e7cdefb e4776798a2a73374b45e6321b60b5578b9fb590c CI 1617799348 +1000 commit: asd diff --git a/test/integration/initialOpen/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 b/test/integration/initialOpen/expected/repo/.git_keep/objects/0e/6cf0a6b79e8d44e186d812a1f74b43d64fac52 deleted file mode 100644 index 7f2ebf4eeb6ad6875bcc2a2b91ca3345ee06b45e..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 52 zcmbmnW01vqb%|NYNpjQ$%9a=IlW-1k=uG&ucRgU5;W^DOJww?yeZ*QuAR%kL b?|FbbA)>kJHEH@MH|3kxP09QKHAXDoL8&<= diff --git a/test/integration/initialOpen/expected/repo/.git_keep/objects/62/b35f5751dd871e0908247223d276b5efeb4cb4 b/test/integration/initialOpen/expected/repo/.git_keep/objects/62/b35f5751dd871e0908247223d276b5efeb4cb4 deleted file mode 100644 index dff6f06c885a035defe52f5b03d8baff6d79f937..0000000000000000000000000000000000000000 GIT binary patch literal 0 HcmV?d00001 literal 57 zcmV-90LK4#0V^p=O;s>AU@$Z=Ff%bx$gNDv%t`~^A08nuUMF0Q* diff --git a/test/integration/initialOpen/expected/repo/.git_keep/objects/e4/776798a2a73374b45e6321b60b5578b9fb590c b/test/integration/initialOpen/expected/repo/.git_keep/objects/e4/776798a2a73374b45e6321b60b5578b9fb590c deleted file mode 100644 index 013f3deb3..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/objects/e4/776798a2a73374b45e6321b60b5578b9fb590c +++ /dev/null @@ -1,2 +0,0 @@ -xM -1 @a=Ei6 "c'Eqw-^]18M2zSHH7\v-T 5o' VVM0N6ϸ/M|S]ub>5Onq8 \ No newline at end of file diff --git a/test/integration/initialOpen/expected/repo/.git_keep/refs/heads/master b/test/integration/initialOpen/expected/repo/.git_keep/refs/heads/master deleted file mode 100644 index 89a4ee75f..000000000 --- a/test/integration/initialOpen/expected/repo/.git_keep/refs/heads/master +++ /dev/null @@ -1 +0,0 @@ -e4776798a2a73374b45e6321b60b5578b9fb590c diff --git a/test/integration/initialOpen/expected/repo/myfile1 b/test/integration/initialOpen/expected/repo/myfile1 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/initialOpen/expected/repo/myfile1 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/initialOpen/expected/repo/myfile2 b/test/integration/initialOpen/expected/repo/myfile2 deleted file mode 100644 index a5bce3fd2..000000000 --- a/test/integration/initialOpen/expected/repo/myfile2 +++ /dev/null @@ -1 +0,0 @@ -test1 diff --git a/test/integration/initialOpen/recording.json b/test/integration/initialOpen/recording.json deleted file mode 100644 index 2fdf83dc0..000000000 --- a/test/integration/initialOpen/recording.json +++ /dev/null @@ -1 +0,0 @@ -{"KeyEvents":[{"Timestamp":891,"Mod":0,"Key":27,"Ch":0},{"Timestamp":1344,"Mod":0,"Key":256,"Ch":32},{"Timestamp":1639,"Mod":0,"Key":256,"Ch":99},{"Timestamp":2128,"Mod":0,"Key":256,"Ch":97},{"Timestamp":2176,"Mod":0,"Key":256,"Ch":115},{"Timestamp":2280,"Mod":0,"Key":256,"Ch":100},{"Timestamp":2592,"Mod":0,"Key":13,"Ch":13},{"Timestamp":2960,"Mod":0,"Key":256,"Ch":113}],"ResizeEvents":[{"Timestamp":0,"Width":272,"Height":74}]} \ No newline at end of file diff --git a/test/integration/initialOpen/setup.sh b/test/integration/initialOpen/setup.sh deleted file mode 100644 index e7de1949f..000000000 --- a/test/integration/initialOpen/setup.sh +++ /dev/null @@ -1,16 +0,0 @@ -#!/bin/sh - -set -e - -cd $1 - -git init - -git config user.email "CI@example.com" -git config user.name "CI" - -echo test1 > myfile1 -git add . -git commit -am "myfile1" - -echo test1 > myfile2 diff --git a/test/integration/initialOpen/test.json b/test/integration/initialOpen/test.json deleted file mode 100644 index f7fd28fab..000000000 --- a/test/integration/initialOpen/test.json +++ /dev/null @@ -1 +0,0 @@ -{ "description": "testing the initial popup appears when first starting lazygit", "speed": 15 }