Skip to content

Commit

Permalink
Fixing that the setup of CustomAdminPrefixTestCases could break other…
Browse files Browse the repository at this point in the history
… tests
  • Loading branch information
Piedone committed Jan 22, 2025
1 parent 4642b4a commit ba3c10f
Showing 1 changed file with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,13 +22,21 @@ public static Task NavigationWithCustomAdminPrefixShouldWorkAsync(
configuration =>
{
configuration.HtmlValidationConfiguration.RunHtmlValidationAssertionOnAllPageChanges = false;

configuration.OrchardCoreConfiguration.BeforeAppStart += (_, argsBuilder) =>
{
argsBuilder.AddWithValue("OrchardCore:OrchardCore_Admin:AdminUrlPrefix", "custom-admin");

return Task.CompletedTask;
};

// Using a custom setup operation so UITT will consider it unique, and not reuse its snapshot with other
// tests if this one ends up running first. This is necessary because the AdminUrlPrefix is saved to the
// DB by the OrchardCore.AdminMenu feature, like for the admin menu's Blog item; we don't want the other
// tests to use that.
var originalSetupOperation = configuration.SetupConfiguration.SetupOperation;
configuration.SetupConfiguration.SetupOperation = context => originalSetupOperation(context);

return Task.CompletedTask;
});
}

0 comments on commit ba3c10f

Please sign in to comment.