Skip to content

Commit

Permalink
fix: added jsonRPCRecorder check on the apiurl
Browse files Browse the repository at this point in the history
  • Loading branch information
acke committed Oct 25, 2024
1 parent 8e17d8e commit 744dd54
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion application/server/execute_command_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,12 @@ func Test_loginCommand_StartsAuthentication(t *testing.T) {
assert.NotEmpty(t, tokenResponse.ResultString())
assert.True(t, fakeAuthenticationProvider.IsAuthenticated)
assert.Eventually(t, func() bool { return len(jsonRPCRecorder.Notifications()) > 0 }, 5*time.Second, 50*time.Millisecond)
assert.Equal(t, 1, len(jsonRPCRecorder.FindNotificationsByMethod("$/snyk.hasAuthenticated")))
notifications := jsonRPCRecorder.FindNotificationsByMethod("$/snyk.hasAuthenticated")
assert.Equal(t, 1, len(notifications))
var hasAuthencticatedNotification types.AuthenticationParams
err = notifications[0].UnmarshalParams(&hasAuthencticatedNotification)
assert.NoError(t, err)
assert.NotEmpty(t, hasAuthencticatedNotification.ApiUrl)
}

func Test_TrustWorkspaceFolders(t *testing.T) {
Expand Down

0 comments on commit 744dd54

Please sign in to comment.