32 lines
961 B
C#
32 lines
961 B
C#
namespace GmRelay.Bot.Tests.Web;
|
|
|
|
public sealed class WebStylesTests
|
|
{
|
|
[Fact]
|
|
public async Task AppCss_ShouldStyleNativeSelectOptionsForReadableDropdowns()
|
|
{
|
|
var css = await File.ReadAllTextAsync(FindRepositoryFile("src/GmRelay.Web/wwwroot/app.css"));
|
|
|
|
Assert.Matches(
|
|
@"select\s+option\s*\{[^}]*background:\s*var\(--bg-secondary\);[^}]*color:\s*var\(--text-primary\);",
|
|
css);
|
|
}
|
|
|
|
private static string FindRepositoryFile(string relativePath)
|
|
{
|
|
var directory = new DirectoryInfo(AppContext.BaseDirectory);
|
|
while (directory is not null)
|
|
{
|
|
var candidate = Path.Combine(directory.FullName, relativePath);
|
|
if (File.Exists(candidate))
|
|
{
|
|
return candidate;
|
|
}
|
|
|
|
directory = directory.Parent;
|
|
}
|
|
|
|
throw new FileNotFoundException($"Could not locate repository file '{relativePath}'.");
|
|
}
|
|
}
|