@@ -21,6 +21,7 @@ import (
2121 tea "charm.land/bubbletea/v2"
2222 huh "charm.land/huh/v2"
2323 "github.com/charmbracelet/x/ansi"
24+ "github.com/slackapi/slack-cli/internal/style"
2425 "github.com/stretchr/testify/assert"
2526)
2627
@@ -39,6 +40,15 @@ func TestCharmInput(t *testing.T) {
3940 assert .Contains (t , view , "Enter your name" )
4041 })
4142
43+ t .Run ("renders the chevron prompt" , func (t * testing.T ) {
44+ var input string
45+ f := buildInputForm ("Name?" , InputPromptConfig {}, & input )
46+ f .Update (f .Init ())
47+
48+ view := ansi .Strip (f .View ())
49+ assert .Contains (t , view , style .Chevron ())
50+ })
51+
4252 t .Run ("accepts typed input" , func (t * testing.T ) {
4353 var input string
4454 f := buildInputForm ("Name?" , InputPromptConfig {}, & input )
@@ -136,7 +146,7 @@ func TestCharmSelect(t *testing.T) {
136146 f .Update (f .Init ())
137147
138148 view := ansi .Strip (f .View ())
139- assert .Contains (t , view , "❱ Foo" )
149+ assert .Contains (t , view , style . Chevron () + " Foo" )
140150 })
141151
142152 t .Run ("cursor navigation moves selection" , func (t * testing.T ) {
@@ -147,8 +157,8 @@ func TestCharmSelect(t *testing.T) {
147157
148158 m , _ := f .Update (tea.KeyPressMsg {Code : tea .KeyDown })
149159 view := ansi .Strip (m .View ())
150- assert .Contains (t , view , "❱ Bar" )
151- assert .False (t , strings .Contains (view , "❱ Foo" ))
160+ assert .Contains (t , view , style . Chevron () + " Bar" )
161+ assert .False (t , strings .Contains (view , style . Chevron () + " Foo" ))
152162 })
153163
154164 t .Run ("submit selects the hovered option" , func (t * testing.T ) {
@@ -207,6 +217,15 @@ func TestCharmPassword(t *testing.T) {
207217 assert .Contains (t , view , "Enter password" )
208218 })
209219
220+ t .Run ("renders the chevron prompt" , func (t * testing.T ) {
221+ var input string
222+ f := buildPasswordForm ("Enter password" , PasswordPromptConfig {}, & input )
223+ f .Update (f .Init ())
224+
225+ view := ansi .Strip (f .View ())
226+ assert .Contains (t , view , style .Chevron ())
227+ })
228+
210229 t .Run ("typed characters are masked in view" , func (t * testing.T ) {
211230 var input string
212231 f := buildPasswordForm ("Password" , PasswordPromptConfig {}, & input )
@@ -302,7 +321,7 @@ func TestCharmFormsUseSlackTheme(t *testing.T) {
302321 f .Update (f .Init ())
303322
304323 view := ansi .Strip (f .View ())
305- assert .Contains (t , view , "❱ A" )
324+ assert .Contains (t , view , style . Chevron () + " A" )
306325 })
307326
308327 t .Run ("multi-select form renders themed prefixes" , func (t * testing.T ) {
0 commit comments