-
-
Notifications
You must be signed in to change notification settings - Fork 638
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
aaa0b6b
commit c133eed
Showing
3 changed files
with
23 additions
and
11 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -124,7 +124,7 @@ func TestUserStorage_Register(t *testing.T) { | |
err = bus.Dispatch(demoTenantCtx, getUser) | ||
Expect(err).IsNil() | ||
|
||
Expect(getUser.Result.ID).Equals(int(6)) | ||
Expect(getUser.Result.ID).Equals(int(7)) | ||
Expect(getUser.Result.Role).Equals(enum.RoleCollaborator) | ||
Expect(getUser.Result.Name).Equals("Rob Stark") | ||
Expect(getUser.Result.Email).Equals("[email protected]") | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -45,7 +45,8 @@ func TestCreatTenant_Success(t *testing.T) { | |
Subdomain: "got", | ||
} | ||
|
||
bus.Dispatch(ctx, createCompanyCmd) | ||
err := bus.Dispatch(ctx, createCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
Expect(httpclientmock.RequestsHistory[0].URL.String()).Equals("https://push.userlist.com/companies") | ||
|
@@ -64,7 +65,8 @@ func TestUpdateTenant_Success(t *testing.T) { | |
BillingStatus: enum.BillingActive, | ||
} | ||
|
||
bus.Dispatch(ctx, updateCompanyCmd) | ||
err := bus.Dispatch(ctx, updateCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
Expect(httpclientmock.RequestsHistory[0].URL.String()).Equals("https://push.userlist.com/companies") | ||
|
@@ -83,7 +85,8 @@ func TestUpdateTenant_BillingStatusUpdatedIfSet(t *testing.T) { | |
BillingStatus: enum.BillingActive, | ||
} | ||
|
||
bus.Dispatch(ctx, updateCompanyCmd) | ||
err := bus.Dispatch(ctx, updateCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -103,7 +106,8 @@ func TestUpdateTenant_BillingStatusNotUpdatedIfNotSet(t *testing.T) { | |
TenantId: 1, | ||
} | ||
|
||
bus.Dispatch(ctx, updateCompanyCmd) | ||
err := bus.Dispatch(ctx, updateCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -122,7 +126,8 @@ func TestUpdateTenant_NameShouldUpdateIfSet(t *testing.T) { | |
TenantId: 1, | ||
} | ||
|
||
bus.Dispatch(ctx, updateCompanyCmd) | ||
err := bus.Dispatch(ctx, updateCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -140,7 +145,8 @@ func TestUpdateTenant_NameShouldNotUpdateIfNotSet(t *testing.T) { | |
TenantId: 1, | ||
} | ||
|
||
bus.Dispatch(ctx, updateCompanyCmd) | ||
err := bus.Dispatch(ctx, updateCompanyCmd) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -154,11 +160,12 @@ func TestUpdateUser_NameOnly(t *testing.T) { | |
env.Config.HostMode = "multi" | ||
reset() | ||
|
||
bus.Dispatch(ctx, &cmd.UserListUpdateUser{ | ||
err := bus.Dispatch(ctx, &cmd.UserListUpdateUser{ | ||
Id: 1, | ||
TenantId: 1, | ||
Name: "Freddy", | ||
}) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -175,11 +182,12 @@ func TestUpdateUser_EmailOnly(t *testing.T) { | |
env.Config.HostMode = "multi" | ||
reset() | ||
|
||
bus.Dispatch(ctx, &cmd.UserListUpdateUser{ | ||
err := bus.Dispatch(ctx, &cmd.UserListUpdateUser{ | ||
Id: 1, | ||
TenantId: 1, | ||
Email: "[email protected]", | ||
}) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|
@@ -196,10 +204,11 @@ func TestMakeUserAdministrator(t *testing.T) { | |
env.Config.HostMode = "multi" | ||
reset() | ||
|
||
bus.Dispatch(ctx, &cmd.UserListHandleRoleChange{ | ||
err := bus.Dispatch(ctx, &cmd.UserListHandleRoleChange{ | ||
Id: 1, | ||
Role: enum.RoleAdministrator, | ||
}) | ||
Expect(err).IsNil() | ||
|
||
Expect(httpclientmock.RequestsHistory).HasLen(1) | ||
|
||
|