Skip to content

Commit

Permalink
Merge pull request #731 from Lombiq/issue/SITE-63
Browse files Browse the repository at this point in the history
SITE-63: Fixing that media theme URLs are not evaluated on tenants with request URL prefix
  • Loading branch information
wAsnk authored Mar 28, 2024
2 parents 8481e53 + 498f5e3 commit 5e57c41
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 3 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,7 @@
using Lombiq.Hosting.MediaTheme.Tests.UI.Extensions;
using Lombiq.Tests.UI.Extensions;
using Lombiq.Tests.UI.Pages;
using Lombiq.Tests.UI.Services;
using System.Threading.Tasks;
using Xunit;
using Xunit.Abstractions;
Expand All @@ -7,16 +10,40 @@ namespace Lombiq.OSOCE.Tests.UI.Tests.ThemeTests;

public class BehaviorMediaThemeTests : UITestBase
{
public const string TestTenantName = "test";

public BehaviorMediaThemeTests(ITestOutputHelper testOutputHelper)
: base(testOutputHelper)
{
}

[Fact]
public Task MediaThemeShouldWorkWhenDeployed() =>
ExecuteTestAfterSetupAsync(context => context.TestMediaThemeDeployedBehaviorAsync());
ExecuteTestAfterSetupAsync(async context =>
{
await context.TestMediaThemeDeployedBehaviorAsync();
await CreateAndSwitchToTenantAsync(context);
await context.TestMediaThemeDeployedBehaviorAsync(TestTenantName);
});

[Fact]
public Task MediaThemeShouldWorkLocally() =>
ExecuteTestAfterSetupAsync(context => context.TestMediaThemeLocalBehaviorAsync());
ExecuteTestAfterSetupAsync(async context =>
{
await context.TestMediaThemeLocalBehaviorAsync();
await CreateAndSwitchToTenantAsync(context);
await context.TestMediaThemeLocalBehaviorAsync();
});

private static Task CreateAndSwitchToTenantAsync(UITestContext context) =>
context.CreateAndSwitchToTenantAsync(
TestTenantName,
TestTenantName,
new OrchardCoreSetupParameters
{
SiteName = "Media Theme Test Tenant",
RecipeId = "Lombiq.OSOCE.Tests",
TablePrefix = TestTenantName,
UserName = "admin",
});
}

0 comments on commit 5e57c41

Please sign in to comment.