Skip to content

Commit

Permalink
Removed a positive case
Browse files Browse the repository at this point in the history
  • Loading branch information
duedares-rvj committed Aug 2, 2024
1 parent 581a279 commit 4eb528d
Showing 1 changed file with 0 additions and 26 deletions.
26 changes: 0 additions & 26 deletions internal/cli/login_test.go
Original file line number Diff line number Diff line change
@@ -1,12 +1,8 @@
package cli

import (
"bytes"
"os"
"testing"

"github.com/auth0/auth0-cli/internal/display"

"github.com/stretchr/testify/assert"
)

Expand Down Expand Up @@ -56,26 +52,4 @@ func TestLoginCommand(t *testing.T) {
err := cmd.Execute()
assert.EqualError(t, err, "flags client-id, client-secret and domain are required together")
})

t.Run("Positive Test: All three params are passed and Machine Flow is executed", func(t *testing.T) {
message := &bytes.Buffer{}
result := &bytes.Buffer{}
cli := &cli{
renderer: &display.Renderer{
MessageWriter: message,
ResultWriter: result,
},
noInput: true,
}

domain := os.Getenv("AUTH0_DOMAIN")
clientID := os.Getenv("AUTH0_CLIENT_ID")
clientSecret := os.Getenv("AUTH0_CLIENT_SECRET")

cmd := loginCmd(cli)
cmd.SetArgs([]string{"--client-id", clientID, "--client-secret", clientSecret, "--domain", domain})
err := cmd.Execute()
assert.NoError(t, err)
assert.Contains(t, message.String(), "Successfully logged in.")
})
}

0 comments on commit 4eb528d

Please sign in to comment.