MCPcopy
hub / github.com/basecamp/once / TestInstallHostnameForm_Submit

Function TestInstallHostnameForm_Submit

internal/ui/install_hostname_form_test.go:11–24  ·  view source on GitHub ↗
(t *testing.T)

Source from the content-addressed store, hash-verified

9)
10
11func TestInstallHostnameForm_Submit(t *testing.T) {
12 form := NewInstallHostnameForm("ghcr.io/basecamp/once-campfire", "")
13
14 hostnameFormTypeText(&form, "chat.example.com")
15 hostnameFormPressTab(&form)
16 form, cmd := form.Update(keyPressMsg("enter"))
17 require.NotNil(t, cmd)
18
19 msg := cmd()
20 submit, ok := msg.(InstallFormSubmitMsg)
21 require.True(t, ok, "expected InstallFormSubmitMsg, got %T", msg)
22 assert.Equal(t, "ghcr.io/basecamp/once-campfire", submit.ImageRef)
23 assert.Equal(t, "chat.example.com", submit.Hostname)
24}
25
26func TestInstallHostnameForm_Cancel(t *testing.T) {
27 form := NewInstallHostnameForm("ghcr.io/basecamp/once-campfire:latest", "")

Callers

nothing calls this directly

Calls 6

UpdateMethod · 0.95
NewInstallHostnameFormFunction · 0.85
hostnameFormTypeTextFunction · 0.85
hostnameFormPressTabFunction · 0.85
keyPressMsgFunction · 0.85
EqualMethod · 0.80

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…