summaryrefslogtreecommitdiffstats
path: root/pkg/integration/tests/stash
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-27 22:52:20 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-27 22:52:20 +1100
commited93e0a2b0943379470049d2a25e4fb828179b97 (patch)
treeb9cb34b8f017912299714fc67a9ca4f50ba63b3d /pkg/integration/tests/stash
parentc5050ecabd57702c7bfb02a38729ed8a4f23b2c5 (diff)
remove dependency on model
Diffstat (limited to 'pkg/integration/tests/stash')
-rw-r--r--pkg/integration/tests/stash/stash.go16
-rw-r--r--pkg/integration/tests/stash/stash_including_untracked_files.go17
2 files changed, 25 insertions, 8 deletions
diff --git a/pkg/integration/tests/stash/stash.go b/pkg/integration/tests/stash/stash.go
index 4265e0c23..c627faaf8 100644
--- a/pkg/integration/tests/stash/stash.go
+++ b/pkg/integration/tests/stash/stash.go
@@ -16,17 +16,25 @@ var Stash = NewIntegrationTest(NewIntegrationTestArgs{
shell.GitAddAll()
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
- t.Model().StashCount(0)
- t.Model().WorkingTreeFileCount(1)
+ t.Views().Stash().
+ IsEmpty()
t.Views().Files().
+ Lines(
+ Contains("file"),
+ ).
Press(keys.Files.ViewStashOptions)
t.ExpectMenu().Title(Equals("Stash options")).Select(MatchesRegexp("stash all changes$")).Confirm()
t.ExpectPrompt().Title(Equals("Stash changes")).Type("my stashed file").Confirm()
- t.Model().StashCount(1)
- t.Model().WorkingTreeFileCount(0)
+ t.Views().Stash().
+ Lines(
+ Contains("my stashed file"),
+ )
+
+ t.Views().Files().
+ IsEmpty()
},
})
diff --git a/pkg/integration/tests/stash/stash_including_untracked_files.go b/pkg/integration/tests/stash/stash_including_untracked_files.go
index d46d7fb1d..756f7948e 100644
--- a/pkg/integration/tests/stash/stash_including_untracked_files.go
+++ b/pkg/integration/tests/stash/stash_including_untracked_files.go
@@ -17,17 +17,26 @@ var StashIncludingUntrackedFiles = NewIntegrationTest(NewIntegrationTestArgs{
shell.GitAdd("file_1")
},
Run: func(t *TestDriver, keys config.KeybindingConfig) {
- t.Model().StashCount(0)
- t.Model().WorkingTreeFileCount(2)
+ t.Views().Stash().
+ IsEmpty()
t.Views().Files().
+ Lines(
+ Contains("file_1"),
+ Contains("file_2"),
+ ).
Press(keys.Files.ViewStashOptions)
t.ExpectMenu().Title(Equals("Stash options")).Select(Contains("stash all changes including untracked files")).Confirm()
t.ExpectPrompt().Title(Equals("Stash changes")).Type("my stashed file").Confirm()
- t.Model().StashCount(1)
- t.Model().WorkingTreeFileCount(0)
+ t.Views().Stash().
+ Lines(
+ Contains("my stashed file"),
+ )
+
+ t.Views().Files().
+ IsEmpty()
},
})