Skip to content

Commit

Permalink
fix test
Browse files Browse the repository at this point in the history
  • Loading branch information
cateiru committed Oct 9, 2023
1 parent 406dffd commit 94cca82
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 2 deletions.
16 changes: 16 additions & 0 deletions src/authentication_request_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,10 @@ func TestCheckUserAuthenticationPossible(t *testing.T) {

a := src.AuthenticationRequest{
AllowRules: []*models.ClientAllowRule{},
Client: &models.Client{
OrgID: null.NewString("", false),
OrgMemberOnly: false,
},
}

ok, err := a.CheckUserAuthenticationPossible(ctx, DB, &u)
Expand All @@ -876,6 +880,10 @@ func TestCheckUserAuthenticationPossible(t *testing.T) {
UserID: null.NewString(u.ID, true),
},
},
Client: &models.Client{
OrgID: null.NewString("", false),
OrgMemberOnly: false,
},
}

ok, err := a.CheckUserAuthenticationPossible(ctx, DB, &u)
Expand All @@ -895,6 +903,10 @@ func TestCheckUserAuthenticationPossible(t *testing.T) {
EmailDomain: null.NewString("example.test", true),
},
},
Client: &models.Client{
OrgID: null.NewString("", false),
OrgMemberOnly: false,
},
}

ok, err := a.CheckUserAuthenticationPossible(ctx, DB, &u)
Expand Down Expand Up @@ -975,6 +987,10 @@ func TestCheckUserAuthenticationPossible(t *testing.T) {
UserID: null.NewString("123", true),
},
},
Client: &models.Client{
OrgID: null.NewString("", false),
OrgMemberOnly: false,
},
}

ok, err := a.CheckUserAuthenticationPossible(ctx, DB, &u)
Expand Down
2 changes: 1 addition & 1 deletion src/main_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ func resetDBTable(ctx context.Context, db *sql.DB) error {
func RandomEmail(t *testing.T) string {
r, err := lib.RandomStr(10)
require.NoError(t, err)
return fmt.Sprintf("%s@example.test", r)
return fmt.Sprintf("%s@example.com", r)
}

// ユーザを新規作成する
Expand Down
2 changes: 1 addition & 1 deletion src/user_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -1376,7 +1376,7 @@ func TestRegisterUser(t *testing.T) {

r, err := lib.RandomStr(10)
require.NoError(t, err)
email := fmt.Sprintf("%s@exammple.test", r) // ドメインを `.test` にする
email := fmt.Sprintf("%s@example.test", r) // ドメインを `.test` にする

u, err := src.RegisterUser(ctx, DB, C, email)
require.NoError(t, err)
Expand Down

0 comments on commit 94cca82

Please sign in to comment.