Codebase list golang-github-nlopes-slack / 0492f2f
change param to optional param alexfernandessd authored 4 years ago James committed 4 years ago
2 changed file(s) with 4 addition(s) and 6 deletion(s). Raw diff Collapse all Expand all
22 // TextInputSubtype Accepts email, number, tel, or url. In some form factors, optimized input is provided for this subtype.
33 type TextInputSubtype string
44
5 // TextInputOption hndle to optional inputs
6 type TextInputOption func(*TextInputOption)
5 // TextInputOption handle to extra inputs options.
6 type TextInputOption func(*TextInputElement)
77
88 const (
99 // InputSubtypeEmail email keyboard
3939 }
4040
4141 for _, opt := range options {
42 opt(&t)
42 opt(t)
4343 }
4444
4545 return t
99 name := "internalName"
1010 label := "Human Readable"
1111 value := "Pre filled text"
12 optional := true
13 textInput := NewTextInput(name, label, value, optional)
12 textInput := NewTextInput(name, label, value)
1413 assert.Equal(t, InputTypeText, textInput.Type)
1514 assert.Equal(t, name, textInput.Name)
1615 assert.Equal(t, label, textInput.Label)
1716 assert.Equal(t, value, textInput.Value)
18 assert.Equal(t, optional, textInput.Optional)
1917 }
2018
2119 func TestNewTextAreaInput(t *testing.T) {