Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bugfix/update account #166

Merged
merged 2 commits into from
Nov 30, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions development-kit/pkg/usecases/auth/auth_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -343,16 +343,15 @@ func TestNewValidateUniqueFromReadCloser(t *testing.T) {

func TestNewPasswordFromReadCloser(t *testing.T) {
t.Run("should return required value when valid password", func(t *testing.T) {
bytes, _ := json.Marshal("")
readCloser := ioutil.NopCloser(strings.NewReader(string(bytes)))
readCloser := ioutil.NopCloser(strings.NewReader(""))

useCases := NewAuthUseCases()
_, err := useCases.NewPasswordFromReadCloser(readCloser)
assert.Error(t, err)
assert.Equal(t, "cannot be blank", err.Error())
})
t.Run("should return not valid length when valid password", func(t *testing.T) {
bytes, _ := json.Marshal("@tEst12")
bytes, _ := json.Marshal("@t3st")
readCloser := ioutil.NopCloser(strings.NewReader(string(bytes)))

useCases := NewAuthUseCases()
Expand Down Expand Up @@ -394,7 +393,7 @@ func TestNewPasswordFromReadCloser(t *testing.T) {
useCases := NewAuthUseCases()
password, err := useCases.NewPasswordFromReadCloser(readCloser)
assert.NoError(t, err)
assert.Equal(t, "@t33sstEE", password)
assert.Equal(t, "\"@t33sstEE\"", password)
})
t.Run("should return error when parsing invalid data", func(t *testing.T) {
useCases := NewAuthUseCases()
Expand Down
Loading