Skip to content

Conversation

@jesseduffield
Copy link
Owner

@jesseduffield jesseduffield commented Dec 23, 2022

  • PR Description

Migrates some more tests. Also adds some helper functions for interacting with popup panels e.g.:

before:

assert.InPrompt()
assert.CurrentViewTitle(Equals("Enter a file name"))
input.Type("my file")
input.Confirm()

assert.InMenu()
assert.CurrentViewTitle(Equals("Choose file content"))
assert.SelectedLine(Contains("foo"))
input.NextItem()
assert.SelectedLine(Contains("bar"))
input.Confirm()

assert.InConfirm()
assert.CurrentViewTitle(Equals("Are you sure?"))
input.Confirm()

after

input.Prompt(Equals("Enter a file name"), "my file")

input.Menu(Equals("Choose file content"), Contains("bar"))

input.AcceptConfirmation(Equals("Are you sure?"), Equals("Are you REALLY sure you want to make this file? Up to you buddy."))

I considered using named arguments via a struct but it's always so annoying having to instantiate the struct at the callsite, and vscode now supports viewing positional arg names inline so I think the position arg approach works.

  • Please check if the PR fulfills these requirements
  • Cheatsheets are up-to-date (run go run scripts/cheatsheet/main.go generate)
  • Code has been formatted (see here)
  • Tests have been added/updated (see here for the integration test guide)
  • Text is internationalised (see here)
  • Docs (specifically docs/Config.md) have been updated if necessary
  • You've read through your own file changes for silly mistakes etc

@jesseduffield jesseduffield force-pushed the yet-more-test-migrations branch 3 times, most recently from 4b1ff09 to 5aa3aa9 Compare December 24, 2022 08:14
@jesseduffield jesseduffield force-pushed the yet-more-test-migrations branch from 5aa3aa9 to b623ecf Compare December 24, 2022 08:16
@jesseduffield jesseduffield merged commit 05425cf into master Dec 24, 2022
@jesseduffield jesseduffield deleted the yet-more-test-migrations branch December 24, 2022 08:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants