← Recipe: add typed navigation

4. Replace tests/smoke.luau

luastra/navigation · checked parameters · about 15 minutes
route sequence test

The test drives the same actions as the buttons and checks every canonical location without needing a browser.

When to use it

Replace the generated smoke test so luastra test verifies the route transitions that the preview exposes.

Focused example

--!strict

local app = require("app/main")

assert(app.snapshot().location == "/", "recipe did not start at home")

app.handle("open-workspace", "routing/workspace", "")
assert(app.snapshot().location == "/workspaces/7", "workspace route failed")

app.handle("open-document", "routing/document", "")
local document = app.snapshot()
assert(document.name == "document", "document route name is invalid")
assert(
    document.location == "/workspaces/7/documents/release-notes?mode=edit",
    "document location is invalid"
)

app.handle("back", "routing/back", "")
assert(app.snapshot().location == "/workspaces/7", "Back failed")

return true

Complete inventory

View all pages in Recipe: add typed navigation
← Previous: 3. Replace src/main.luauNext: 5. Check and run →