test: enhance service test coverage and add audit tests
Ultraworked with [Sisyphus](https://github.com/code-yeongyu/oh-my-opencode) Co-authored-by: Sisyphus <clio-agent@sisyphuslabs.ai>
This commit is contained in:
@@ -159,12 +159,15 @@ func (s *SuperTestSuite) Test_CreateTenant() {
|
||||
So(t.UserID, ShouldEqual, u.ID)
|
||||
So(t.Status, ShouldEqual, consts.TenantStatusVerified)
|
||||
So(t.ExpiredAt.After(startAt), ShouldBeTrue)
|
||||
So(t.ExpiredAt.Before(startAt.AddDate(0, 0, 8)), ShouldBeTrue)
|
||||
So(t.ExpiredAt.After(startAt.AddDate(0, 0, 6)), ShouldBeTrue)
|
||||
|
||||
tu, _ := models.TenantUserQuery.WithContext(ctx).
|
||||
Where(models.TenantUserQuery.TenantID.Eq(t.ID), models.TenantUserQuery.UserID.Eq(u.ID)).
|
||||
First()
|
||||
So(tu, ShouldNotBeNil)
|
||||
So(tu.Status, ShouldEqual, consts.UserStatusVerified)
|
||||
So(tu.Role, ShouldResemble, types.Array[consts.TenantUserRole]{consts.TenantUserRoleTenantAdmin})
|
||||
})
|
||||
})
|
||||
}
|
||||
@@ -1361,6 +1364,12 @@ func (s *SuperTestSuite) Test_PayoutAccountCreateUpdate() {
|
||||
So(updated.ReviewedBy, ShouldEqual, int64(0))
|
||||
So(updated.ReviewReason, ShouldEqual, "")
|
||||
})
|
||||
|
||||
Convey("should get creator settings", func() {
|
||||
res, err := Super.GetCreatorSettings(ctx, tenant.ID)
|
||||
So(err, ShouldBeNil)
|
||||
So(res.Name, ShouldEqual, "Payout Tenant 2")
|
||||
})
|
||||
})
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user