routertest

package
v4.2.0 Latest Latest
Warning

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

Go to latest
Published: Jul 5, 2026 License: MIT Imports: 3 Imported by: 0

Documentation

Overview

Package routertest provides a first public router-test harness for js/wasm tests.

It builds on testkit/render and the public router package so tests can set an initial path, navigate, inspect params and query state, and assert rendered route output without relying on repo-local router test helpers.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type Fixture

type Fixture struct{}

Fixture wraps one router plus a rendered route fixture.

func NewHash

func NewHash(parseTb testing.TB, parseOptions ...any) *Fixture

func NewHistory

func NewHistory(parseTb testing.TB, parseOptions ...any) *Fixture

func (*Fixture) AllByRole

func (parseF *Fixture) AllByRole(parseRole string) []*render.QueryNode

func (*Fixture) ApplyByDescription

func (parseF *Fixture) ApplyByDescription(parseDescription string) *render.QueryNode

func (*Fixture) ApplyByLabel

func (parseF *Fixture) ApplyByLabel(parseLabel string) *render.QueryNode

func (*Fixture) ApplyByLiveRegion

func (parseF *Fixture) ApplyByLiveRegion(parsePoliteness string, parseText string) *render.QueryNode

func (*Fixture) ApplyByRole

func (parseF *Fixture) ApplyByRole(parseRole string, parseName string) *render.QueryNode

func (*Fixture) ByDescription

func (parseF *Fixture) ByDescription(parseDescription string) *render.QueryNode

func (*Fixture) ByID

func (parseF *Fixture) ByID(parseId string) *render.QueryNode

func (*Fixture) ByLabel

func (parseF *Fixture) ByLabel(parseLabel string) *render.QueryNode

func (*Fixture) ByLiveRegion

func (parseF *Fixture) ByLiveRegion(parsePoliteness string, parseText string) *render.QueryNode

func (*Fixture) ByRole

func (parseF *Fixture) ByRole(parseRole string, parseName string) *render.QueryNode

func (*Fixture) ByText

func (parseF *Fixture) ByText(parseText string) *render.QueryNode

func (*Fixture) ChangeByID

func (parseF *Fixture) ChangeByID(parseId string, parseValue string)

func (*Fixture) Cleanup

func (parseF *Fixture) Cleanup()

func (*Fixture) ClickByID

func (parseF *Fixture) ClickByID(parseId string)

func (*Fixture) DispatchByID

func (parseF *Fixture) DispatchByID(parseId string, parseProperty string, parseEvent render.Event)

func (*Fixture) InputByID

func (parseF *Fixture) InputByID(parseId string, parseValue string)

func (*Fixture) Inspect

func (parseF *Fixture) Inspect() Inspection

func (*Fixture) Navigate

func (parseF *Fixture) Navigate(parsePath string)

func (*Fixture) Params

func (parseF *Fixture) Params() map[string]string

func (*Fixture) Path

func (parseF *Fixture) Path() string

func (*Fixture) Query

func (parseF *Fixture) Query() url.Values

func (*Fixture) Register

func (parseF *Fixture) Register(parsePath string, parseComponent any, parseOptions ...any)

func (*Fixture) Render

func (parseF *Fixture) Render()

func (*Fixture) Replace

func (parseF *Fixture) Replace(parsePath string)

func (*Fixture) Router

func (parseF *Fixture) Router() any

func (*Fixture) SetPath

func (parseF *Fixture) SetPath(parsePath string)

func (*Fixture) SubmitByID

func (parseF *Fixture) SubmitByID(parseId string)

func (*Fixture) Text

func (parseF *Fixture) Text() string

type Inspection

type Inspection struct {
	Path   string
	Query  url.Values
	Params map[string]string
}

Inspection mirrors the route details exposed by the wasm fixture.

Jump to

Keyboard shortcuts

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