summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:35:36 +1100
committerJesse Duffield <jessedduffield@gmail.com>2022-12-27 21:35:36 +1100
commit78b495f50a080822121852dfdf27b481dbbd8879 (patch)
tree63c519494d4b1a3e3bbe266b8b87a869ba84edc9
parent53e06b71aecd2ddaf80516627ba223ac2adc5420 (diff)
rename input to t
-rw-r--r--pkg/integration/README.md26
-rw-r--r--pkg/integration/components/alert_asserter.go6
-rw-r--r--pkg/integration/components/commit_message_panel_asserter.go8
-rw-r--r--pkg/integration/components/confirmation_asserter.go6
-rw-r--r--pkg/integration/components/menu_asserter.go6
-rw-r--r--pkg/integration/components/prompt_asserter.go20
-rw-r--r--pkg/integration/components/test.go10
-rw-r--r--pkg/integration/components/test_driver.go (renamed from pkg/integration/components/input.go)68
-rw-r--r--pkg/integration/components/test_test.go20
-rw-r--r--pkg/integration/components/view.go51
-rw-r--r--pkg/integration/components/views.go18
-rw-r--r--pkg/integration/tests/bisect/basic.go20
-rw-r--r--pkg/integration/tests/bisect/from_other_branch.go14
-rw-r--r--pkg/integration/tests/branch/checkout_by_name.go8
-rw-r--r--pkg/integration/tests/branch/delete.go8
-rw-r--r--pkg/integration/tests/branch/rebase.go22
-rw-r--r--pkg/integration/tests/branch/rebase_and_drop.go26
-rw-r--r--pkg/integration/tests/branch/reset.go10
-rw-r--r--pkg/integration/tests/branch/suggestions.go8
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick.go18
-rw-r--r--pkg/integration/tests/cherry_pick/cherry_pick_conflicts.go32
-rw-r--r--pkg/integration/tests/commit/commit.go10
-rw-r--r--pkg/integration/tests/commit/commit_multiline.go16
-rw-r--r--pkg/integration/tests/commit/new_branch.go10
-rw-r--r--pkg/integration/tests/commit/revert.go12
-rw-r--r--pkg/integration/tests/commit/staged.go32
-rw-r--r--pkg/integration/tests/commit/staged_without_hooks.go22
-rw-r--r--pkg/integration/tests/commit/unstaged.go24
-rw-r--r--pkg/integration/tests/config/remote_named_star.go4
-rw-r--r--pkg/integration/tests/custom_commands/basic.go6
-rw-r--r--pkg/integration/tests/custom_commands/form_prompts.go18
-rw-r--r--pkg/integration/tests/custom_commands/menu_from_command.go16
-rw-r--r--pkg/integration/tests/custom_commands/menu_from_commands_output.go14
-rw-r--r--pkg/integration/tests/custom_commands/multiple_prompts.go18
-rw-r--r--pkg/integration/tests/diff/diff.go32
-rw-r--r--pkg/integration/tests/diff/diff_and_apply_patch.go32
-rw-r--r--pkg/integration/tests/diff/diff_commits.go18
-rw-r--r--pkg/integration/tests/file/dir_with_untracked_file.go6
-rw-r--r--pkg/integration/tests/file/discard_changes.go12
-rw-r--r--pkg/integration/tests/interactive_rebase/amend_merge.go16
-rw-r--r--pkg/integration/tests/interactive_rebase/one.go6
-rw-r--r--pkg/integration/tests/misc/confirm_on_quit.go8
-rw-r--r--pkg/integration/tests/stash/rename.go6
-rw-r--r--pkg/integration/tests/stash/stash.go16
-rw-r--r--pkg/integration/tests/stash/stash_including_untracked_files.go16
45 files changed, 376 insertions, 399 deletions
diff --git a/pkg/integration/README.md b/pkg/integration/README.md
index fe4f43ac1..2da3b5f81 100644
--- a/pkg/integration/README.md
+++ b/pkg/integration/README.md
@@ -24,16 +24,15 @@ In the setup step, we prepare a repo with shell commands, for example, creating
### Run step
-The run step has four arguments passed in:
+The run step has three arguments passed in:
1. `shell`
-2. `input`
-3. `assert`
+2. `t` (the test driver)
4. `keys`
`shell` we've already seen in the setup step. The reason it's passed into the run step is that we may want to emulate background events. For example, the user modifying a file outside of lazygit.
-`input` is for driving the gui by pressing certain keys, selecting list items, etc.
+`t` is for driving the gui by pressing certain keys, selecting list items, etc.
`assert` is for asserting on the state of the lazygit session. When you call a method on `assert`, the assert struct will wait for the assertion to hold true and then continue (failing the test after a timeout). For this reason, assertions have two purposes: one is to ensure the test fails as soon as something unexpected happens, but another is to allow lazygit to process a keypress before you follow up with more keypresses. If you input a bunch of keypresses too quickly lazygit might get confused.
@@ -43,32 +42,21 @@ The run step has four arguments passed in:
Try to do as much setup work as possible in your setup step. For example, if all you're testing is that the user is able to resolve merge conflicts, create the merge conflicts in the setup step. On the other hand, if you're testing to see that lazygit can warn the user about merge conflicts after an attempted merge, it's fine to wait until the run step to actually create the conflicts. If the run step is focused on the thing you're trying to test, the test will run faster and its intent will be clearer.
-#### Assert after input
-
-Use assertions to ensure that lazygit has processed all your keybindings so far. Each time you press a key, something should happen on the screen, so you should assert that that thing has happened. This means we won't get into trouble from keys being entered two quickly because at each stage we ensure the key has been processed. This also makes tests more readable because they help explain what we expect to be happening on-screen. For example:
-
-```go
-input.press(keys.Files.CommitChanges)
-input.InCommitMessagePanel()
-```
-
-Note that there are some `input` methods that have assertions baked in, such as the `SwitchToView` methods.
-
#### Create helper functions for (very) frequently used test logic
-If you find yourself doing something frequently in a test, consider making it a method in one of the helper arguments. For example, instead of calling `input.PressKey(keys.Universal.Confirm)` in 100 places, it's better to have a method `input.Confirm()`. This is not to say that everything should be made into a method on the input struct: just things that are particularly common in tests.
+If you find yourself doing something frequently in a test, consider making it a method in one of the helper arguments. For example, instead of calling `t.PressKey(keys.Universal.Confirm)` in 100 places, it's better to have a method `t.Confirm()`. This is not to say that everything should be made into a helper method: just things that are particularly common in tests.
Also, given how often we need to select a menu item or type into a prompt panel, there are some helper functions for that. For example:
```go
// asserts that a prompt opens with the title 'Enter a file name', and then types 'my file' and confirms
-input.Prompt(Equals("Enter a file name"), "my file")
+t.Prompt(Equals("Enter a file name"), "my file")
// asserts that a menu opens with the title: 'Choose file content', and then selects the option which contains 'bar'
-input.Menu(Equals("Choose file content"), Contains("bar"))
+t.Menu(Equals("Choose file content"), Contains("bar"))
// asserts a confirmation appears with the title 'Are you sure?' and the content 'Are you REALLY sure' and then confirms
-input.AcceptConfirmation(Equals("Are you sure?"), Equals("Are you REALLY sure?"))
+t.AcceptConfirmation(Equals("Are you sure?"), Equals("Are you REALLY sure?"))
```
## Running tests
diff --git a/pkg/integration/components/alert_asserter.go b/pkg/integration/components/alert_asserter.go
index abc2f1171..2010af3b8 100644
--- a/pkg/integration/components/alert_asserter.go
+++ b/pkg/integration/components/alert_asserter.go
@@ -1,13 +1,13 @@
package components
type AlertAsserter struct {
- input *Input
+ t *TestDriver
hasCheckedTitle bool
hasCheckedContent bool
}
func (self *AlertAsserter) getViewAsserter() *View {
- return self.input.Views().Confirmation()
+ return self.t.Views().Confirmation()
}
// asserts that the alert view has the expected title
@@ -42,6 +42,6 @@ func (self *AlertAsserter) Cancel() {
func (self *AlertAsserter) checkNecessaryChecksCompleted() {
if !self.hasCheckedContent || !self.hasCheckedTitle {
- self.input.Fail("You must both check the content and title of a confirmation popup by calling Title()/Content() before calling Confirm()/Cancel().")
+ self.t.Fail("You must both check the content and title of a confirmation popup by calling Title()/Content() before calling Confirm()/Cancel().")
}
}
diff --git a/pkg/integration/components/commit_message_panel_asserter.go b/pkg/integration/components/commit_message_panel_asserter.go
index 9aacacf89..aad82720f 100644
--- a/pkg/integration/components/commit_message_panel_asserter.go
+++ b/pkg/integration/components/commit_message_panel_asserter.go
@@ -1,11 +1,11 @@
package components
type CommitMessagePanelAsserter struct {
- input *Input
+ t *TestDriver
}
func (self *CommitMessagePanelAsserter) getViewAsserter() *View {
- return self.input.Views().CommitMessage()
+ return self.t.Views().CommitMessage()
}
// asserts on the text initially present in the prompt
@@ -16,13 +16,13 @@ func (self *CommitMessagePanelAsserter) InitialText(expected *matcher) *CommitMe
}
func (self *CommitMessagePanelAsserter) Type(value string) *CommitMessagePanelAsserter {
- self.input.typeContent(value)
+ self.t.typeContent(value)
return self
}
func (self *CommitMessagePanelAsserter) AddNewline() *CommitMessagePanelAsserter {
- self.input.press(self.input.keys.Universal.AppendNewline)
+ self.t.press(self.t.keys.Universal.AppendNewline)
return self
}
diff --git a/pkg/integration/components/confirmation_asserter.go b/pkg/integration/components/confirmation_asserter.go
index 2d3d87ba0..b226f0885 100644
--- a/pkg/integration/components/confirmation_asserter.go
+++ b/pkg/integration/components/confirmation_asserter.go
@@ -1,13 +1,13 @@
package components
type ConfirmationAsserter struct {
- input *Input
+ t *TestDriver
hasCheckedTitle bool
hasCheckedContent bool
}
func (self *ConfirmationAsserter) getViewAsserter() *View {
- return self.input.Views().Confirmation()
+ return self.t.Views().Confirmation()
}
// asserts that the confirmation view has the expected title
@@ -42,6 +42,6 @@ func (self *ConfirmationAsserter) Cancel() {
func (self *ConfirmationAsserter) checkNecessaryChecksCompleted() {
if !self.hasCheckedContent || !self.hasCheckedTitle {
- self.input.Fail("You must both check the content and title of a confirmation popup by calling Title()/Content() before calling Confirm()/Cancel().")
+ self.t.Fail("You must both check the content and title of a confirmation popup by calling Title()/Content() before calling Confirm()/Cancel().")
}
}
diff --git a/pkg/integration/components/menu_asserter.go b/pkg/integration/components/menu_asserter.go
index 4f1fd035a..42e31a610 100644
--- a/pkg/integration/components/menu_asserter.go
+++ b/pkg/integration/components/menu_asserter.go
@@ -1,12 +1,12 @@
package components
type MenuAsserter struct {
- input *Input
+ t *TestDriver
hasCheckedTitle bool
}
func (self *MenuAsserter) getViewAsserter() *View {
- return self.input.Views().Menu()
+ return self.t.Views().Menu()
}
// asserts that the popup has the expected title
@@ -38,6 +38,6 @@ func (self *MenuAsserter) Select(option *matcher) *MenuAsserter {
func (self *MenuAsserter) checkNecessaryChecksCompleted() {
if !self.hasCheckedTitle {
- self.input.Fail("You must check the title of a menu popup by calling Title() before calling Confirm()/Cancel().")
+ self.t.Fail("You must check the title of a menu popup by calling Title() before calling Confirm()/Cancel().")
}
}
diff --git a/pkg/integration/components/prompt_asserter.go b/pkg/integration/components/prompt_asserter.go
index 343d9d54b..9fea5bdf2 100644
--- a/pkg/integration/components/prompt_asserter.go
+++ b/pkg/integration/components/prompt_asserter.go
@@ -1,12 +1,12 @@
package components
type PromptAsserter struct {
- input *Input
+ t *TestDriver
hasCheckedTitle bool
}
func (self *PromptAsserter) getViewAsserter() *View {
- return self.input.Views().Confirmation()
+ return self.t.Views().Confirmation()
}
// asserts that the popup has the expected title
@@ -26,7 +26,7 @@ func (self *PromptAsserter) InitialText(expected *matcher) *PromptAsserter {
}
func (self *PromptAsserter) Type(value string) *PromptAsserter {
- self.input.typeContent(value)
+ self.t.typeContent(value)
return self
}
@@ -49,25 +49,25 @@ func (self *PromptAsserter) Cancel() {
func (self *PromptAsserter) checkNecessaryChecksCompleted() {
if !self.hasCheckedTitle {
- self.input.Fail("You must check the title of a prompt popup by calling Title() before calling Confirm()/Cancel().")
+ self.t.Fail("You must check the title of a prompt popup by calling Title() before calling Confirm()/Cancel().")
}
}
func (self *PromptAsserter) SuggestionLines(matchers ...*matcher) *PromptAsserter {
- self.input.Views().Suggestions().Lines(matchers...)
+ self.t.Views().Suggestions().Lines(matchers...)
return self
}
func (self *PromptAsserter) SuggestionTopLines(matchers ...*matcher) *PromptAsserter {
- self.input.Views().Suggestions().TopLines(matchers...)
+ self.t.Views().Suggestions().TopLines(matchers...)
return self
}
func (self *PromptAsserter) SelectFirstSuggestion() *PromptAsserter {
- self.input.press(self.input.keys.Universal.TogglePanel)
- self.input.Views().Suggestions().
+ self.t.press(self.t.keys.Universal.TogglePanel)
+ self.t.Views().Suggestions().
IsFocused().
SelectedLineIdx(0)
@@ -75,8 +75,8 @@ func (self *PromptAsserter) SelectFirstSuggestion() *PromptAsserter {
}
func (self *PromptAsserter) SelectSuggestion(matcher *matcher) *PromptAsserter {
- self.input.press(self.input.keys.Universal.TogglePanel)
- self.input.Views().Suggestions().
+ self.t.press(self.t.keys.Universal.TogglePanel)
+ self.t.Views().Suggestions().
IsFocused().
NavigateToListItem(matcher)
diff --git a/pkg/integration/components/test.go b/pkg/integration/components/test.go
index 705323ecb..927dfb36c 100644
--- a/pkg/integration/components/test.go
+++ b/pkg/integration/components/test.go
@@ -25,7 +25,7 @@ type IntegrationTest struct {
setupConfig func(config *config.AppConfig)
run func(
shell *Shell,
- input *Input,
+ testController *TestDriver,
keys config.KeybindingConfig,
)
}
@@ -40,7 +40,7 @@ type NewIntegrationTestArgs struct {
// takes a config and mutates. The mutated context will end up being passed to the gui
SetupConfig func(config *config.AppConfig)
// runs the test
- Run func(shell *Shell, input *Input, keys config.KeybindingConfig)
+ Run func(shell *Shell, t *TestDriver, keys config.KeybindingConfig)
// additional args passed to lazygit
ExtraCmdArgs string
// for when a test is flakey
@@ -94,13 +94,13 @@ func (self *IntegrationTest) SetupRepo(shell *Shell) {
func (self *IntegrationTest) Run(gui integrationTypes.GuiDriver) {
shell := NewShell("/tmp/lazygit-test")
keys := gui.Keys()
- input := NewInput(gui, keys, KeyPressDelay())
+ testController := NewTestController(gui, keys, KeyPressDelay())
- self.run(shell, input, keys)
+ self.run(shell, testController, keys)
if KeyPressDelay() > 0 {
// the dev would want to see the final state if they're running in slow mode
- input.Wait(2000)
+ testController.Wait(2000)
}
}
diff --git a/pkg/integration/components/input.go b/pkg/integration/components/test_driver.go
index d5db33518..7b3fb0889 100644
--- a/pkg/integration/components/input.go
+++ b/pkg/integration/components/test_driver.go
@@ -11,15 +11,15 @@ import (
"github.com/samber/lo"
)
-type Input struct {
+type TestDriver struct {
gui integrationTypes.GuiDriver
keys config.KeybindingConfig
pushKeyDelay int
*assertionHelper
}
-func NewInput(gui integrationTypes.GuiDriver, keys config.KeybindingConfig, pushKeyDelay int) *Input {
- return &Input{
+func NewTestController(gui integrationTypes.GuiDriver, keys config.KeybindingConfig, pushKeyDelay int) *TestDriver {
+ return &TestDriver{
gui: gui,
keys: keys,
pushKeyDelay: pushKeyDelay,
@@ -29,19 +29,19 @@ func NewInput(gui integrationTypes.GuiDriver, keys config.KeybindingConfig, push
// key is something like 'w' or '<space>'. It's best not to pass a direct value,
// but instead to go through the default user config to get a more meaningful key name
-func (self *Input) press(keyStr string) {
+func (self *TestDriver) press(keyStr string) {
self.Wait(self.pushKeyDelay)
self.gui.PressKey(keyStr)
}
-func (self *Input) typeContent(content string) {
+func (self *TestDriver) typeContent(content string) {
for _, char := range content {
self.press(string(char))
}
}
-func (self *Input) ContinueMerge() {
+func (self *TestDriver) ContinueMerge() {
self.Views().current().Press(self.keys.Universal.CreateRebaseOptionsMenu)
self.ExpectMenu().
@@ -50,20 +50,20 @@ func (self *Input) ContinueMerge() {
Confirm()
}
-func (self *Input) ContinueRebase() {
+func (self *TestDriver) ContinueRebase() {
self.ContinueMerge()
}
// for when you want to allow lazygit to process something before continuing
-func (self *Input) Wait(milliseconds int) {
+func (self *TestDriver) Wait(milliseconds int) {
time.Sleep(time.Duration(milliseconds) * time.Millisecond)
}
-func (self *Input) LogUI(message string) {
+func (self *TestDriver) LogUI(message string) {
self.gui.LogUI(message)
}
-func (self *Input) Log(message string) {
+func (self *TestDriver) Log(message string) {
self.gui.LogUI(message)
}
@@ -78,7 +78,7 @@ func (self *Input) Log(message string) {
// If this changes in future, we'll need to update this code to first attempt to find the item
// in the current page and failing that, jump to the top of the view and iterate through all of it,
// looking for the item.
-func (self *Input) navigateToListItem(matcher *matcher) {
+func (self *TestDriver) navigateToListItem(matcher *matcher) {
self.inListContext()
currentContext := self.gui.CurrentContext().(types.IListContext)
@@ -128,7 +128,7 @@ func (self *Input) navigateToListItem(matcher *matcher) {
}
}
-func (self *Input) inListContext() {
+func (self *TestDriver) inListContext() {
self.assertWithRetries(func() (bool, string) {
currentContext := self.gui.CurrentContext()
_, ok := currentContext.(types.IListContext)
@@ -136,39 +136,39 @@ func (self *Input) inListContext() {
})
}
-func (self *Input) ExpectConfirmation() *ConfirmationAsserter {
+func (self *TestDriver) ExpectConfirmation() *ConfirmationAsserter {
self.inConfirm()
- return &ConfirmationAsserter{input: self}
+ return &ConfirmationAsserter{t: self}
}
-func (self *Input) inConfirm() {
+func (self *TestDriver) inConfirm() {
self.assertWithRetries(func() (bool, string) {
currentView := self.gui.CurrentContext().GetView()
return currentView.Name() == "confirmation" && !currentView.Editable, "Expected confirmation popup to be focused"
})
}
-func (self *Input) ExpectPrompt() *PromptAsserter {
+func (self *TestDriver) ExpectPrompt() *PromptAsserter {
self.inPrompt()
- return &PromptAsserter{input: self}
+ return &PromptAsserter{t: self}
}
-func (self *Input) inPrompt() {
+func (self *TestDriver) inPrompt() {
self.assertWithRetries(func() (bool, string) {
currentView := self.gui.CurrentContext().GetView()
return currentView.Name() == "confirmation" && currentView.Editable, "Expected prompt popup to be focused"
})
}
-func (self *Input) ExpectAlert() *AlertAsserter {
+func (self *TestDriver) ExpectAlert() *AlertAsserter {
self.inAlert()
- return &AlertAsserter{input: self}
+ return &AlertAsserter{t: self}
}
-func (self *Input) inAlert() {
+func (self *TestDriver) inAlert() {
// basically the same thing as a confirmation popup with the current implementation
self.assertWithRetries(func() (bool, string) {
currentView := self.gui.CurrentContext().GetView()
@@ -176,32 +176,32 @@ func (self *Input) inAlert() {
})
}
-func (self *Input) ExpectMenu() *MenuAsserter {
+func (self *TestDriver) ExpectMenu() *MenuAsserter {
self.inMenu()
- return &MenuAsserter{input: self}
+ return &MenuAsserter{t: self}
}
-func (self *Input) inMenu() {
+func (self *TestDriver) inMenu() {
self.assertWithRetries(func() (bool, string) {
return self.gui.CurrentContext().GetView().Name() == "menu", "Expected popup menu to be focused"
})
}
-func (self *Input) ExpectCommitMessagePanel() *CommitMessagePanelAsserter {
+func (self *TestDriver) ExpectCommitMessagePanel() *CommitMessagePanelAsserter {
self.inCommitMessagePanel()
- return &CommitMessagePanelAsserter{input: self}
+ return &CommitMessagePanelAsserter{t: self}
}
-func (self *Input) inCommitMessagePanel() {
+func (self *TestDriver) inCommitMessagePanel() {
self.assertWithRetries(func() (bool, string) {
currentView := self.gui.CurrentContext().GetView()
return currentView.Name() == "commitMessage", "Expected commit message panel to be focused"
})
}
-func (self *Input) currentWindowName(expectedWindowName string) {
+func (self *TestDriver) currentWindowName(expectedWindowName string) {
self.assertWithRetries(func() (bool, string) {
actual := self.gui.CurrentContext().GetView().Name()
return actual == expectedWindowName, fmt.Sprintf("Expected current window name to be '%s', but got '%s'", expectedWindowName, actual)
@@ -209,27 +209,27 @@ func (self *Input) currentWindowName(expectedWindowName string) {
}
// for making assertions on lazygit views
-func (self *Input) Views() *Views {
- return &Views{input: self}
+func (self *TestDriver) Views() *Views {
+ return &Views{t: self}
}
// for making assertions on the lazygit model
-func (self *Input) Model() *Model {
+func (self *TestDriver) Model() *Model {
return &Model{assertionHelper: self.assertionHelper, gui: self.gui}
}
// for making assertions on the file system
-func (self *Input) FileSystem() *FileSystem {
+func (self *TestDriver) FileSystem() *FileSystem {
return &FileSystem{assertionHelper: self.assertionHelper}
}
// for when you just want to fail the test yourself.
// This runs callbacks to ensure we render the error after closing the gui.
-func (self *Input) Fail(message string) {
+func (self *TestDriver) Fail(message string) {
self.assertionHelper.fail(message)
}
-func (self *Input) NotInPopup() {
+func (self *TestDriver) NotInPopup() {
self.assertWithRetries(func() (bool, string) {
viewName := self.gui.CurrentContext().GetView().Name()
return !lo.Contains([]string{"menu", "confirmation", "commitMessage"}, viewName), fmt.Sprintf("Unexpected popup view present: %s view", viewName)
diff --git a/pkg/integration/components/test_test.go b/pkg/integration/components/test_test.go
index 1356fbf3b..79d2b3955 100644
--- a/pkg/integration/components/test_test.go
+++ b/pkg/integration/components/test_test.go
@@ -63,10 +63,10 @@ func (self *fakeGuiDriver) View(viewName string) *gocui.View {
func TestAssertionFailure(t *testing.T) {
test := NewIntegrationTest(NewIntegrationTestArgs{
Description: unitTestDescription,
- Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
- input.press("a")
- input.press("b")
- input.Model().CommitCount(2)
+ Run: func(shell *Shell, t *TestDriver, keys config.KeybindingConfig) {
+ t.press("a")
+ t.press("b")
+ t.Model().CommitCount(2)
},
})
driver := &fakeGuiDriver{}
@@ -78,8 +78,8 @@ func TestAssertionFailure(t *testing.T) {
func TestManualFailure(t *testing.T) {
test := NewIntegrationTest(NewIntegrationTestArgs{
Description: unitTestDescription,
- Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
- input.Fail("blah")
+ Run: func(shell *Shell, t *TestDriver, keys config.KeybindingConfig) {
+ t.Fail("blah")
},
})
driver := &fakeGuiDriver{}
@@ -90,10 +90,10 @@ func TestManualFailure(t *testing.T) {
func TestSuccess(t *testing.T) {
test := NewIntegrationTest(NewIntegrationTestArgs{
Description: unitTestDescription,
- Run: func(shell *Shell, input *Input, keys config.KeybindingConfig) {
- input.press("a")
- input.press("b")
- input.Model().CommitCount(0)
+ Run: func(shell *Shell, t *TestDriver, keys config.KeybindingConfig) {
+ t.press("a")
+ t.press("b")
+ t.Model().CommitCount(0)
},
})
driver := &fakeGuiDriver{}
diff --git a/pkg/integration/components/view.go b/pkg/integration/components/view.go
index cda5f