From f38492ea177e7e154a8a2c22b721bf826e915fa3 Mon Sep 17 00:00:00 2001 From: Sebastian Date: Mon, 13 Jul 2020 15:03:12 +0200 Subject: [PATCH] Bug fixes for broken merge. --- .../Apps/Indexes/AppsIndex.cs | 2 +- .../Schemas/Indexes/SchemasIndex.cs | 2 +- .../Apps/Indexes/AppsIndexTests.cs | 4 ++++ .../Schemas/Indexes/SchemasIndexTests.cs | 8 ++++---- .../Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs | 2 +- 5 files changed, 11 insertions(+), 7 deletions(-) diff --git a/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs index cea62616c..bbed4e578 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Apps/Indexes/AppsIndex.cs @@ -237,7 +237,7 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes await RemoveContributorAsync(removeContributor); break; - case ArchiveApp archiveApp: + case ArchiveApp _: await ArchiveAppAsync(app); break; } diff --git a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs index 474cf946a..afe5b876f 100644 --- a/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs +++ b/backend/src/Squidex.Domain.Apps.Entities/Schemas/Indexes/SchemasIndex.cs @@ -93,7 +93,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes } } - var schema = await GetSchemaCoreAsync(id); + var schema = await GetSchemaCoreAsync(DomainId.Combine(appId, id)); if (schema != null) { diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs index 35259b0cc..e2efdbfc2 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Apps/Indexes/AppsIndexTests.cs @@ -311,6 +311,8 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes [Fact] public async Task Should_add_app_to_index_on_contributor_assignment() { + SetupApp(); + var command = new AssignContributor { AppId = appId, ContributorId = userId }; var context = @@ -326,6 +328,8 @@ namespace Squidex.Domain.Apps.Entities.Apps.Indexes [Fact] public async Task Should_remove_from_user_index_on_remove_of_contributor() { + SetupApp(); + var command = new RemoveContributor { AppId = appId, ContributorId = userId }; var context = diff --git a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs index 425aa08c0..a94333d99 100644 --- a/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs +++ b/backend/tests/Squidex.Domain.Apps.Entities.Tests/Schemas/Indexes/SchemasIndexTests.cs @@ -57,7 +57,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes Assert.Same(expected, actual1); Assert.Same(expected, actual2); - A.CallTo(() => grainFactory.GetGrain(schemaId.Id.ToString(), null)) + A.CallTo(() => grainFactory.GetGrain(A._, null)) .MustHaveHappenedTwiceExactly(); A.CallTo(() => index.GetIdAsync(A._)) @@ -80,7 +80,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes Assert.Same(expected, actual2); Assert.Same(expected, actual3); - A.CallTo(() => grainFactory.GetGrain(schemaId.Id.ToString(), null)) + A.CallTo(() => grainFactory.GetGrain(A._, null)) .MustHaveHappenedOnceExactly(); A.CallTo(() => index.GetIdAsync(A._)) @@ -98,7 +98,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes Assert.Same(expected, actual1); Assert.Same(expected, actual2); - A.CallTo(() => grainFactory.GetGrain(schemaId.Id.ToString(), null)) + A.CallTo(() => grainFactory.GetGrain(A._, null)) .MustHaveHappenedTwiceExactly(); A.CallTo(() => index.GetIdAsync(A._)) @@ -118,7 +118,7 @@ namespace Squidex.Domain.Apps.Entities.Schemas.Indexes Assert.Same(expected, actual2); Assert.Same(expected, actual3); - A.CallTo(() => grainFactory.GetGrain(schemaId.Id.ToString(), null)) + A.CallTo(() => grainFactory.GetGrain(A._, null)) .MustHaveHappenedOnceExactly(); A.CallTo(() => index.GetIdAsync(A._)) diff --git a/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs b/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs index 169aaaed1..70d77706e 100644 --- a/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs +++ b/backend/tests/Squidex.Web.Tests/Pipeline/SchemaResolverTests.cs @@ -66,7 +66,7 @@ namespace Squidex.Web.Pipeline { actionContext.RouteData.Values["name"] = schemaId.Id.ToString(); - A.CallTo(() => appProvider.GetSchemaAsync(appId.Id, A._, false, false)) + A.CallTo(() => appProvider.GetSchemaAsync(appId.Id, A._, false, true)) .Returns(Task.FromResult(null)); await sut.OnActionExecutionAsync(actionExecutingContext, next);