Documentation
¶
Overview ¶
Package testapi provides test utilities and application state export for testing.
Index ¶
- type AppState
- type StateExporter
- func (e *StateExporter) GetCurrentView() string
- func (e *StateExporter) GetModalName() string
- func (e *StateExporter) GetState() *AppState
- func (e *StateExporter) GetStateJSON() (string, error)
- func (e *StateExporter) GetViewNames() []string
- func (e *StateExporter) IsCmdVisible() bool
- func (e *StateExporter) IsModalOpen() bool
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type AppState ¶
type AppState struct {
CurrentView string `json:"current_view"`
ModalOpen bool `json:"modal_open"`
ModalName string `json:"modal_name"`
CmdVisible bool `json:"cmd_visible"`
ViewNames []string `json:"view_names"`
}
AppState represents the exportable state of the application
type StateExporter ¶
type StateExporter struct {
// contains filtered or unexported fields
}
StateExporter provides methods to export application state for testing
func NewStateExporter ¶
func NewStateExporter(s9sApp *app.S9s) *StateExporter
NewStateExporter creates a new state exporter for the given app
func (*StateExporter) GetCurrentView ¶
func (e *StateExporter) GetCurrentView() string
GetCurrentView returns the name of the current view
func (*StateExporter) GetModalName ¶
func (e *StateExporter) GetModalName() string
GetModalName returns the name of the open modal
func (*StateExporter) GetState ¶
func (e *StateExporter) GetState() *AppState
GetState returns the current application state
func (*StateExporter) GetStateJSON ¶
func (e *StateExporter) GetStateJSON() (string, error)
GetStateJSON returns the current application state as JSON
func (*StateExporter) GetViewNames ¶
func (e *StateExporter) GetViewNames() []string
GetViewNames returns all available view names
func (*StateExporter) IsCmdVisible ¶
func (e *StateExporter) IsCmdVisible() bool
IsCmdVisible returns whether the command line is visible
func (*StateExporter) IsModalOpen ¶
func (e *StateExporter) IsModalOpen() bool
IsModalOpen returns whether a modal is open