Giving up at UI testing

This commit is contained in:
Paul Schneider 2026-06-15 00:00:39 +01:00
commit 69e81b9fd4
5 changed files with 23 additions and 17 deletions

View file

@ -115,17 +115,16 @@ namespace Yavsc.Tests
public async Task SetupHost()
{
Environment.SetEnvironmentVariable("ASPNETCORE_ENVIRONMENT", "Development");
// Set ContentRoot to the Yavsc.Org project directory so WebRootPath resolves correctly
var cwd = System.IO.Directory.GetCurrentDirectory();
var yavscOrgPath = Path.GetFullPath(
Path.Combine(cwd,
"../../../../../src/Yavsc.Org"));
Environment.CurrentDirectory = yavscOrgPath;
var builder = WebApplication.CreateBuilder();
builder.Environment.EnvironmentName = "Development";
builder.Environment.ContentRootPath = yavscOrgPath;
var builder = WebApplication.CreateBuilder();
var slnDir = builder.Configuration.GetValue<string>("SLNDIR");
Assert.NotNull(slnDir);
var yavscOrgPath = Path.GetFullPath(
Path.Combine(slnDir,
"src/Yavsc.Org"));
Environment.CurrentDirectory = yavscOrgPath;
builder.AddConfiguration("org").AddInMemoryCollection(new Dictionary<string, string?>
{