mirror of https://gitee.com/answerdev/answer.git
fix: repo test set notification userID to correct
This commit is contained in:
parent
0c1a77d52c
commit
4075739fec
|
@ -81,7 +81,7 @@ func Test_notificationRepo_GetNotificationPage(t *testing.T) {
|
||||||
err := notificationRepo.AddNotification(context.TODO(), ent)
|
err := notificationRepo.AddNotification(context.TODO(), ent)
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
|
|
||||||
notificationPage, total, err := notificationRepo.GetNotificationPage(context.TODO(), &schema.NotificationSearch{UserID: userID})
|
notificationPage, total, err := notificationRepo.GetNotificationPage(context.TODO(), &schema.NotificationSearch{UserID: ent.UserID})
|
||||||
assert.NoError(t, err)
|
assert.NoError(t, err)
|
||||||
assert.True(t, total > 0)
|
assert.True(t, total > 0)
|
||||||
assert.Equal(t, notificationPage[0].UserID, ent.UserID)
|
assert.Equal(t, notificationPage[0].UserID, ent.UserID)
|
||||||
|
|
|
@ -52,7 +52,8 @@ var (
|
||||||
func TestMain(t *testing.M) {
|
func TestMain(t *testing.M) {
|
||||||
dbSetting, ok := dbSettingMapping[os.Getenv("TEST_DB_DRIVER")]
|
dbSetting, ok := dbSettingMapping[os.Getenv("TEST_DB_DRIVER")]
|
||||||
if !ok {
|
if !ok {
|
||||||
dbSetting = dbSettingMapping[string(schemas.MYSQL)]
|
// Use sqlite3 to test.
|
||||||
|
dbSetting = dbSettingMapping[string(schemas.SQLITE)]
|
||||||
}
|
}
|
||||||
defer func() {
|
defer func() {
|
||||||
if tearDown != nil {
|
if tearDown != nil {
|
||||||
|
|
Loading…
Reference in New Issue