-
Notifications
You must be signed in to change notification settings - Fork 73
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add test to confirm that propagatedclaims are correctly propagated al…
…l the way from UserSignup to UserAccount (#813)
- Loading branch information
Showing
1 changed file
with
33 additions
and
0 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 |
---|---|---|
|
@@ -284,6 +284,39 @@ func (s *userSignupIntegrationTest) TestUserResourcesCreatedWhenOriginalSubIsSet | |
VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base") | ||
} | ||
|
||
func (s *userSignupIntegrationTest) TestUserResourcesUpdatedWhenPropagatedClaimsModified() { | ||
hostAwait := s.Host() | ||
|
||
// given | ||
hostAwait.UpdateToolchainConfig(s.T(), testconfig.AutomaticApproval().Enabled(true)) | ||
|
||
// when | ||
userSignup, _ := NewSignupRequest(s.Awaitilities). | ||
Username("test-user-resources-updated"). | ||
Email("[email protected]"). | ||
UserID("43215432"). | ||
AccountID("ppqnnn00099"). | ||
EnsureMUR(). | ||
RequireConditions(wait.ConditionSet(wait.Default(), wait.ApprovedAutomatically())...). | ||
Execute(s.T()).Resources() | ||
|
||
// then | ||
VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base") | ||
|
||
// Update the UserSignup | ||
userSignup, err := hostAwait.UpdateUserSignup(s.T(), userSignup.Name, func(us *toolchainv1alpha1.UserSignup) { | ||
// Modify the user's AccountID | ||
us.Spec.IdentityClaims.AccountID = "nnnbbb111234" | ||
}) | ||
require.NoError(s.T(), err) | ||
|
||
// Confirm the AccountID is updated | ||
require.Equal(s.T(), "nnnbbb111234", userSignup.Spec.IdentityClaims.AccountID) | ||
|
||
// Verify that the resources are updated with the propagated claim | ||
VerifyResourcesProvisionedForSignup(s.T(), s.Awaitilities, userSignup, "deactivate30", "base") | ||
} | ||
|
||
// TestUserResourcesCreatedWhenOriginalSubIsSetAndUserIDSameAsSub tests the case where: | ||
// | ||
// 1. sub claim set manually by test | ||
|