-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' into feature/exclusions-section-content-tweaks
- Loading branch information
Showing
46 changed files
with
438 additions
and
233 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
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 |
---|---|---|
|
@@ -73,7 +73,6 @@ public void OnPost_ShouldUpdateSessionAndRedirect_WhenModelStateIsValid() | |
_addUserModel.FirstName = "John"; | ||
_addUserModel.LastName = "Johnson"; | ||
_addUserModel.Email = "[email protected]"; | ||
_addUserModel.IsAdmin = true; | ||
_addUserModel.Role = OrganisationPersonScopes.Editor; | ||
|
||
var initialState = new PersonInviteState(); | ||
|
@@ -86,7 +85,6 @@ public void OnPost_ShouldUpdateSessionAndRedirect_WhenModelStateIsValid() | |
state.FirstName == "John" && | ||
state.LastName == "Johnson" && | ||
state.Email == "[email protected]" && | ||
state.Scopes.Contains(OrganisationPersonScopes.Admin) && | ||
state.Scopes.Contains(OrganisationPersonScopes.Editor) | ||
)), Times.Once); | ||
|
||
|
@@ -111,11 +109,13 @@ public void UpdateFields_ShouldUpdateAllFields_WhenFieldsAreNotEmpty() | |
Assert.Equal("[email protected]", updatedState.Email); | ||
} | ||
|
||
[Fact] | ||
public void UpdateScopes_ShouldUpdateScopes_WhenIsAdminAndRoleIsEditor() | ||
[Theory] | ||
[InlineData(OrganisationPersonScopes.Viewer)] | ||
[InlineData(OrganisationPersonScopes.Editor)] | ||
[InlineData(OrganisationPersonScopes.Admin)] | ||
public void UpdateScopes_ShouldUpdateScopes_WhenRoleIsSelected(string organisationPersonScope) | ||
{ | ||
_addUserModel.IsAdmin = true; | ||
_addUserModel.Role = OrganisationPersonScopes.Editor; | ||
_addUserModel.Role = organisationPersonScope; | ||
|
||
var initialState = new PersonInviteState | ||
{ | ||
|
@@ -124,10 +124,7 @@ public void UpdateScopes_ShouldUpdateScopes_WhenIsAdminAndRoleIsEditor() | |
|
||
var updatedState = _addUserModel.UpdateScopes(initialState); | ||
|
||
Assert.Contains(OrganisationPersonScopes.Admin, updatedState.Scopes ?? []); | ||
Assert.Contains(OrganisationPersonScopes.Editor, updatedState.Scopes ?? []); | ||
Assert.Contains(OrganisationPersonScopes.Responder, updatedState.Scopes ?? []); | ||
Assert.DoesNotContain(OrganisationPersonScopes.Viewer, updatedState.Scopes ?? []); | ||
Assert.Contains(organisationPersonScope, updatedState.Scopes ?? []); | ||
} | ||
|
||
[Fact] | ||
|
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
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
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
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
Oops, something went wrong.