@@ -19,8 +19,8 @@ import (
1919 "fmt"
2020 "testing"
2121
22- tea "github.com/charmbracelet/ bubbletea"
23- "github.com/charmbracelet/ huh"
22+ tea "charm.land/ bubbletea/v2 "
23+ huh "charm.land/ huh/v2 "
2424 "github.com/charmbracelet/x/ansi"
2525 "github.com/slackapi/slack-cli/internal/shared"
2626 "github.com/stretchr/testify/assert"
@@ -77,7 +77,7 @@ func TestBuildTemplateSelectionForm(t *testing.T) {
7777 doAllUpdates (f , f .Init ())
7878
7979 // Submit first option (Starter app -> getting-started)
80- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyEnter })
80+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
8181 doAllUpdates (f , cmd )
8282
8383 view := ansi .Strip (f .View ())
@@ -95,13 +95,13 @@ func TestBuildTemplateSelectionForm(t *testing.T) {
9595 doAllUpdates (f , f .Init ())
9696
9797 // Navigate down to "View more samples" (4th option, index 3)
98- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyDown })
98+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
9999 doAllUpdates (f , cmd )
100- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyDown })
100+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
101101 doAllUpdates (f , cmd )
102- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyDown })
102+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
103103 doAllUpdates (f , cmd )
104- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
104+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
105105 doAllUpdates (f , cmd )
106106
107107 assert .Equal (t , viewMoreSamples , category )
@@ -119,11 +119,11 @@ func TestBuildTemplateSelectionForm(t *testing.T) {
119119 doAllUpdates (f , f .Init ())
120120
121121 // Navigate to Automation app (3rd option, index 2) and submit
122- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyDown })
122+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
123123 doAllUpdates (f , cmd )
124- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyDown })
124+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
125125 doAllUpdates (f , cmd )
126- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
126+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
127127 doAllUpdates (f , cmd )
128128
129129 view := ansi .Strip (f .View ())
@@ -140,10 +140,10 @@ func TestBuildTemplateSelectionForm(t *testing.T) {
140140 doAllUpdates (f , f .Init ())
141141
142142 // Select first category (Starter app)
143- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyEnter })
143+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
144144 doAllUpdates (f , cmd )
145145 // Select first template (Bolt for JavaScript)
146- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
146+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
147147 doAllUpdates (f , cmd )
148148
149149 assert .Equal (t , "slack-cli#getting-started" , category )
@@ -176,10 +176,10 @@ func TestCharmPromptTemplateSelection(t *testing.T) {
176176 runForm = func (f * huh.Form ) error {
177177 doAllUpdates (f , f .Init ())
178178 // Select first category (Starter app)
179- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyEnter })
179+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
180180 doAllUpdates (f , cmd )
181181 // Select first template (Bolt for JavaScript)
182- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
182+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
183183 doAllUpdates (f , cmd )
184184 return nil
185185 }
@@ -212,16 +212,16 @@ func TestCharmPromptTemplateSelection(t *testing.T) {
212212 runForm = func (f * huh.Form ) error {
213213 doAllUpdates (f , f .Init ())
214214 // Navigate to "View more samples" (4th option)
215- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyDown })
215+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
216216 doAllUpdates (f , cmd )
217- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyDown })
217+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
218218 doAllUpdates (f , cmd )
219- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyDown })
219+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
220220 doAllUpdates (f , cmd )
221- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
221+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
222222 doAllUpdates (f , cmd )
223223 // Select "Browse sample gallery..."
224- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
224+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
225225 doAllUpdates (f , cmd )
226226 return nil
227227 }
@@ -240,12 +240,12 @@ func TestCharmPromptTemplateSelection(t *testing.T) {
240240 runForm = func (f * huh.Form ) error {
241241 doAllUpdates (f , f .Init ())
242242 // Navigate to "AI Agent app" (2nd option)
243- _ , cmd := f .Update (tea.KeyMsg { Type : tea .KeyDown })
243+ _ , cmd := f .Update (tea.KeyPressMsg { Code : tea .KeyDown })
244244 doAllUpdates (f , cmd )
245- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
245+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
246246 doAllUpdates (f , cmd )
247247 // Select first template (Bolt for JavaScript)
248- _ , cmd = f .Update (tea.KeyMsg { Type : tea .KeyEnter })
248+ _ , cmd = f .Update (tea.KeyPressMsg { Code : tea .KeyEnter })
249249 doAllUpdates (f , cmd )
250250 return nil
251251 }
0 commit comments