Skip to content

Commit

Permalink
Merge pull request #4748 from dfe-analytical-services/dev
Browse files Browse the repository at this point in the history
Merge Dev into Master
  • Loading branch information
N-moh authored Apr 12, 2024
2 parents b003f4e + 842ca6e commit 9616c08
Show file tree
Hide file tree
Showing 275 changed files with 14,887 additions and 5,922 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -91,3 +91,6 @@ src/GovUk.Education.ExploreEducationStatistics.Admin/appsettings.IdpBootstrapUse

## IdentityServer Developer Signing key
**/*/tempkey.rsa

## IDE Files (e.g. local Visual Studio configuration)
*.csproj.user
4 changes: 3 additions & 1 deletion .husky/pre-commit
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
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
"scripts": {
"prepare": "husky install",
"preinstall": "pnpm check:node",
"clean": "pnpm -r --parallel exec rm -rf node_modules && rm -rf node_modules",
"clean": "pnpm -r --parallel exec rm -rf node_modules && rm -rf node_modules && rm -rf src/explore-education-statistics-frontend/.next",
"check:node": "check-node-version --package",
"fix": "pnpm fix:js && pnpm fix:style",
"fix:js": "eslint --fix --ext .ts,.tsx,.js,.jsx .",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ public async Task UpdateRelease_Returns_Ok()
var releaseService = new Mock<IReleaseService>(Strict);

releaseService
.Setup(s => s.UpdateRelease(
.Setup(s => s.UpdateReleaseVersion(
It.Is<Guid>(id => id.Equals(_releaseVersionId)),
It.IsAny<ReleaseUpdateRequest>())
)
Expand Down

This file was deleted.

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)));
}
}
}

This file was deleted.

Loading

0 comments on commit 9616c08

Please sign in to comment.