-
Notifications
You must be signed in to change notification settings - Fork 5
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4748 from dfe-analytical-services/dev
Merge Dev into Master
- Loading branch information
Showing
275 changed files
with
14,887 additions
and
5,922 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,6 @@ | ||
#!/bin/sh | ||
. "$(dirname "$0")/_/husky.sh" | ||
|
||
./node_modules/.bin/lint-staged | ||
if [ -d "./node_modules/.bin/lint-staged" ]; then | ||
./node_modules/.bin/lint-staged | ||
fi |
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
172 changes: 0 additions & 172 deletions
172
...ics.Admin.Tests/Security/AuthorizationHandlers/LegacyReleaseAuthorizationHandlersTests.cs
This file was deleted.
Oops, something went wrong.
53 changes: 53 additions & 0 deletions
53
...ests/Security/AuthorizationHandlers/PublicationReleaseSeriesAuthorizationHandlersTests.cs
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 |
---|---|---|
@@ -0,0 +1,53 @@ | ||
#nullable enable | ||
using System.Threading.Tasks; | ||
using GovUk.Education.ExploreEducationStatistics.Admin.Security.AuthorizationHandlers; | ||
using GovUk.Education.ExploreEducationStatistics.Admin.Services; | ||
using GovUk.Education.ExploreEducationStatistics.Admin.Services.Interfaces; | ||
using GovUk.Education.ExploreEducationStatistics.Content.Model; | ||
using GovUk.Education.ExploreEducationStatistics.Content.Model.Database; | ||
using Moq; | ||
using Xunit; | ||
using static GovUk.Education.ExploreEducationStatistics.Admin.Security.SecurityClaimTypes; | ||
using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Security.AuthorizationHandlers.Utils. | ||
AuthorizationHandlersTestUtil; | ||
using static GovUk.Education.ExploreEducationStatistics.Admin.Tests.Security.AuthorizationHandlers.Utils. | ||
PublicationAuthorizationHandlersTestUtil; | ||
using static GovUk.Education.ExploreEducationStatistics.Content.Model.PublicationRole; | ||
using static Moq.MockBehavior; | ||
using ReleaseVersionRepository = GovUk.Education.ExploreEducationStatistics.Content.Model.Repository.ReleaseVersionRepository; | ||
|
||
namespace GovUk.Education.ExploreEducationStatistics.Admin.Tests.Security.AuthorizationHandlers; | ||
|
||
// ReSharper disable once ClassNeverInstantiated.Global | ||
public class PublicationReleaseSeriesAuthorizationHandlersTests | ||
{ | ||
public class ManagePublicationReleaseSeriesAuthorizationHandlerTests | ||
{ | ||
[Fact] | ||
public async Task ManagePublicationReleaseSeries_Claims() | ||
{ | ||
await AssertHandlerSucceedsWithCorrectClaims<Publication, ManagePublicationReleaseSeriesRequirement>( | ||
CreateHandler, | ||
new Publication(), | ||
UpdateAllPublications | ||
); | ||
} | ||
|
||
[Fact] | ||
public async Task ManagePublicationReleaseSeries_PublicationRoles() | ||
{ | ||
await AssertPublicationHandlerSucceedsWithPublicationRoles<ManagePublicationReleaseSeriesRequirement>( | ||
CreateHandler, Owner); | ||
} | ||
|
||
private static ManagePublicationReleaseSeriesAuthorizationHandler CreateHandler(ContentDbContext contentDbContext) | ||
{ | ||
return new ManagePublicationReleaseSeriesAuthorizationHandler( | ||
new AuthorizationHandlerService( | ||
new ReleaseVersionRepository(contentDbContext), | ||
Mock.Of<IUserReleaseRoleRepository>(Strict), | ||
new UserPublicationRoleRepository(contentDbContext), | ||
Mock.Of<IPreReleaseService>(Strict))); | ||
} | ||
} | ||
} |
85 changes: 0 additions & 85 deletions
85
...on.ExploreEducationStatistics.Admin.Tests/Services/LegacyReleaseServicePermissionTests.cs
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.