testapi

package
v0.4.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Feb 8, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package testapi provides test utilities and application state export for testing.

Index

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

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL