In types.go, the tableGeneration() function currently creates the table model and runs the BubbleTea program in the same function. This makes it difficult to test with teatest because the model creation logic can't be accessed separately.
This function will be split into two separate functions:
func createTypeSelectionTable() model {}
- This will focus on creating and returning the table as a BubbleTea
model
func runTypeSelectionTable(endpoint string) error {}
- This will focus on running the above
model
In
types.go, thetableGeneration()function currently creates the table model and runs the BubbleTea program in the same function. This makes it difficult to test withteatestbecause the model creation logic can't be accessed separately.This function will be split into two separate functions:
func createTypeSelectionTable() model {}modelfunc runTypeSelectionTable(endpoint string) error {}model