From f238ca28232f816f844df41fbe51829c98dd479e Mon Sep 17 00:00:00 2001 From: Abisheik Date: Sun, 12 Apr 2026 20:22:26 +0530 Subject: [PATCH] Fix invite test setup for deactivated-user case --- server/channels/api4/team_test.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/server/channels/api4/team_test.go b/server/channels/api4/team_test.go index 42c1fecbd1a..8ec0d9f196f 100644 --- a/server/channels/api4/team_test.go +++ b/server/channels/api4/team_test.go @@ -4080,8 +4080,13 @@ func TestInviteUsersToTeam(t *testing.T) { }, "rate limits") th.TestForAllClients(t, func(t *testing.T, client *model.Client4) { + th.App.UpdateConfig(func(cfg *model.Config) { *cfg.TeamSettings.RestrictCreationToDomains = "" }) + th.BasicTeam.AllowedDomains = "" + _, appErr := th.App.UpdateTeam(th.BasicTeam) + require.Nil(t, appErr) + deactivatedUser := th.CreateUser(t) - _, appErr := th.App.UpdateActive(th.Context, deactivatedUser, false) + _, appErr = th.App.UpdateActive(th.Context, deactivatedUser, false) require.Nil(t, appErr) invitesWithErrors, _, err := client.InviteUsersToTeamGracefully(context.Background(), th.BasicTeam.Id, []string{deactivatedUser.Email, user1})