@@ -310,44 +310,6 @@ func TestUpdateNotification(t *testing.T) {
310310 assert .Contains (t , output .String (), "New lstk version available" )
311311 })
312312
313- t .Run ("never" , func (t * testing.T ) {
314- configFile := filepath .Join (t .TempDir (), "config.toml" )
315- require .NoError (t , os .WriteFile (configFile , []byte ("[cli]\n update_prompt = true\n " ), 0o644 ))
316-
317- ctx , cancel := context .WithTimeout (context .Background (), 30 * time .Second )
318- defer cancel ()
319-
320- cmd := exec .CommandContext (ctx , tmpBinary , "--config" , configFile )
321- cmd .Env = env .Without (env .AuthToken ).With (env .AuthToken , "fake-token" ).With (env .APIEndpoint , mockServer .URL )
322-
323- ptmx , err := pty .Start (cmd )
324- require .NoError (t , err , "failed to start command in PTY" )
325- defer func () { _ = ptmx .Close () }()
326-
327- output := & syncBuffer {}
328- outputCh := make (chan struct {})
329- go func () {
330- _ , _ = io .Copy (output , ptmx )
331- close (outputCh )
332- }()
333-
334- require .Eventually (t , func () bool {
335- return bytes .Contains (output .Bytes (), []byte ("New lstk version available" ))
336- }, 10 * time .Second , 100 * time .Millisecond , "update notification prompt should appear" )
337-
338- _ , err = ptmx .Write ([]byte ("n" ))
339- require .NoError (t , err )
340-
341- _ = cmd .Wait ()
342- <- outputCh
343-
344- assert .Contains (t , output .String (), "New lstk version available" )
345-
346- // Verify config was updated to disable future prompts
347- configData , err := os .ReadFile (configFile )
348- require .NoError (t , err )
349- assert .Contains (t , string (configData ), "update_prompt = false" )
350- })
351313
352314 t .Run ("update" , func (t * testing.T ) {
353315 // Copy binary since it will be replaced during the update
0 commit comments