github.com/eliastor/durgaform@v0.0.0-20220816172711-d0ab2d17673e/internal/legacy/durgaform/ui_input_prefix_test.go (about) 1 package durgaform 2 3 import ( 4 "context" 5 "testing" 6 ) 7 8 func TestPrefixUIInput_impl(t *testing.T) { 9 var _ UIInput = new(PrefixUIInput) 10 } 11 12 func TestPrefixUIInput(t *testing.T) { 13 input := new(MockUIInput) 14 prefix := &PrefixUIInput{ 15 IdPrefix: "foo", 16 UIInput: input, 17 } 18 19 _, err := prefix.Input(context.Background(), &InputOpts{Id: "bar"}) 20 if err != nil { 21 t.Fatalf("err: %s", err) 22 } 23 24 if input.InputOpts.Id != "foo.bar" { 25 t.Fatalf("bad: %#v", input.InputOpts) 26 } 27 }