Skip to content
Merged
Changes from 1 commit
Commits
Show all changes
49 commits
Select commit Hold shift + click to select a range
202c1ad
feat(prompter): add accessible prompter support
BagToad Mar 31, 2025
7b0c095
feat(md prompter): md prompt respects blankAllowed
BagToad Mar 31, 2025
e973ee3
fix(md prompter): accessible prompt allows blank
BagToad Mar 31, 2025
92b1a8e
test(prompter): remove t.parallel calls
BagToad Mar 31, 2025
88a98ea
feat(prompter): include `no` as false-y value
BagToad Apr 2, 2025
f7de9e0
test(prompter): `go-expect` based prompter tests
BagToad Apr 2, 2025
94bbd26
fix(prompter): rename huhprompter
BagToad Apr 2, 2025
0d7fd36
test(prompter): replace assert with require
BagToad Apr 2, 2025
e42af35
tests(prompter): rename huhprompter
BagToad Apr 2, 2025
e299b56
test(prompter): remove needless variable declaration
BagToad Apr 2, 2025
8827803
test(prompter): skip vt10x tests on Windows
BagToad Apr 2, 2025
88e6285
test(prompter): move to external package
BagToad Apr 3, 2025
02fc12e
fix(linter): linter errors
BagToad Apr 3, 2025
49ddacf
docs(prompter): doc prompter interface
BagToad Apr 3, 2025
a30df14
refactor(prompter): rename env var for speech synthesizer friendly pr…
BagToad Apr 3, 2025
5b0d49c
test(prompter): more tests for bad input
BagToad Apr 4, 2025
4cf048a
fix(prompter): input returns default when blank
BagToad Apr 4, 2025
5c39e0b
fix(prompter): notes about Confirm default
BagToad Apr 4, 2025
2e48cad
fix(prompter): remove impossible condition
BagToad Apr 4, 2025
0b49522
refactor(prompter): less magic strings
BagToad Apr 4, 2025
f897001
doc(prompter): clarify comments
BagToad Apr 4, 2025
5996f88
doc(envs): speech synthesis prompter
BagToad Apr 7, 2025
2a851e3
test(prompter): fix race conditions
BagToad Apr 7, 2025
0543aac
test(prompter): add basic survey prompter test
BagToad Apr 7, 2025
6640740
doc: comment typos and formatting
BagToad Apr 7, 2025
c5ffb3c
test: use example.com in tests
BagToad Apr 7, 2025
fb80b5b
test(prompter): remove needless NO_COLOR set
BagToad Apr 7, 2025
d8d3874
fix(prompter): use os.lookupenv for accessible prompter
BagToad Apr 8, 2025
ef58e62
test(prompter): timeout for tests is 1s
BagToad Apr 8, 2025
c4be95a
refactor(prompter): remove unused variable
BagToad Apr 8, 2025
8821f77
doc(prompter): remove senseless comment
BagToad Apr 8, 2025
9cf3413
refactor(prompter): explicit return values
BagToad Apr 8, 2025
19387b8
fix(prompter): rename GH_ACCESSIBLE_PROMPTER
BagToad Apr 8, 2025
fa03157
doc(help): label GH_ACCESSIBLE_PROMPTER as preview
BagToad Apr 8, 2025
d230b08
test(prompter): re-add skipped test for accessible confirm default
BagToad Apr 8, 2025
8615632
Merge branch 'trunk' into kw/first-pass-accessible-prompter
BagToad Apr 9, 2025
3b2e7f7
chore: go mod tidy
BagToad Apr 9, 2025
a34c9ea
doc(prompter env): accessible prompter includes braille reader
BagToad Apr 9, 2025
8fc8486
refactor(prompter): rename speechSynthesizerFriendlyPrompter to acces…
BagToad Apr 9, 2025
2f5e896
fix(prompter): update `huh` and fix tests
BagToad Apr 9, 2025
fab0de5
fix(prompter): pass io to `huh` and refactor tests
BagToad Apr 9, 2025
4615069
chore: go mod tidy
BagToad Apr 9, 2025
47d6032
test(prompter): use *testing.T instead
BagToad Apr 10, 2025
8b70870
test(prompter): describe why echo is editorcmd
BagToad Apr 10, 2025
9eee77a
test(prompter): doc how accessible prompter tests work
BagToad Apr 10, 2025
20ff409
fix(prompter): remove needless default value assignment
BagToad Apr 10, 2025
b8cd094
Ensure markdown confirm prompt shows editor name
andyfeller Apr 10, 2025
8cd3992
test(prompter): fix race condition
BagToad Apr 10, 2025
70537de
test(prompter): fix invalid comment
BagToad Apr 10, 2025
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
test(prompter): doc how accessible prompter tests work
  • Loading branch information
BagToad committed Apr 10, 2025
commit 9eee77a2bf290558d65c6111b5c9ed53bd5648fe
13 changes: 13 additions & 0 deletions internal/prompter/accessible_prompter_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,19 @@ import (
"github.com/stretchr/testify/require"
)

// The following tests are broadly testing the accessible prompter, and NOT asserting
// on the prompter's complete and exact output strings.
//
// These tests generally operate with this logic:
// - Wait for a particular substring (a portion of the prompt) to appear
// - Send input
// - Wait for another substring to appear or for control to return to the test
// - Assert that the input value was returned from the prompter function

// In the future, expanding these tests to assert on the exact prompt strings
// would help build confidence in `huh` upgrades, but for now these tests
// are sufficient to ensure that the accessible prompter behaves roughly as expected
// but doesn't mandate that prompts always look exactly the same.
func TestAccessiblePrompter(t *testing.T) {
Comment thread
BagToad marked this conversation as resolved.
t.Run("Select", func(t *testing.T) {
console := newTestVirtualTerminal(t)
Expand Down
Loading