Documentation ¶
Overview ¶
Package dialog contains shared components to build full dialog screens out of.
Index ¶
- Constants
- func FormattedSecret(secret string, aborted bool) string
- func FormattedSelection(selection string, aborted bool) string
- func FormattedToken(token string, aborted bool) string
- func RadioList[S fmt.Stringer](entries list.Entries[S], cursor int, title, help string, inputs TestInput) (selected S, aborted bool, err error)
- func SendInputs(inputs TestInput, program *tea.Program)
- func TextDisplay(title, text string, inputs TestInput) (bool, error)
- func TextField(args TextFieldArgs) (string, bool, error)
- type TestInput
- type TestInputs
- type TextFieldArgs
Constants ¶
const TestInputKey = "GITTOWN_DIALOG_INPUT"
TestInputKey specifies the name of environment variables containing input for dialogs in end-to-end tests.
const WindowSize = 9
how many elements to display in the dialog
Variables ¶
This section is empty.
Functions ¶
func FormattedSecret ¶
FormattedToken provides the given API token in a printable format.
func FormattedSelection ¶
FormattedSelection provides the given dialog choice in a printable format.
func FormattedToken ¶
FormattedToken provides the given API token in a printable format.
func RadioList ¶
func RadioList[S fmt.Stringer](entries list.Entries[S], cursor int, title, help string, inputs TestInput) (selected S, aborted bool, err error)
RadioList lets the user select a new main branch for this repo.
func SendInputs ¶
SendInputs sends the given keystrokes to the given bubbletea program.
Types ¶
type TestInput ¶
TestInput contains the input for a single dialog in an end-to-end test.
func ParseTestInput ¶
ParseTestInput converts the given input data in the environment variable format into the format understood by Git Town's dialogs.
type TestInputs ¶
type TestInputs []TestInput
TestInputs contains the input for all dialogs in an end-to-end test.
func LoadTestInputs ¶
func LoadTestInputs(environmenttVariables []string) TestInputs
LoadTestInputs provides the TestInputs to use in an end-to-end test, taken from the given environment variable snapshot.
func (*TestInputs) Next ¶
func (self *TestInputs) Next() TestInput
Next provides the TestInput for the next dialog in an end-to-end test.