Fix six failing tests
- SheetMonth takes the short months from a fixed list instead of the host's ICU data, which abbreviates March as "Mär." in newer CLDR versions - FirstSentence treats only one- or two-digit numbers as ordinals, so a year such as "2025." ends the sentence - Route smoke tests allow the scoped-CSS attribute after href and decode entities before matching umlauts and dashes Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
1 parent
55cd201429
commit
be1ea4452f
3 files changed
+31
-12
No files matched your search
@@ -239,7 +239,7 @@ public sealed partial class RouteSmokeTests : IDisposable
|
||||
var client = _factory.CreateClient();
|
||||
|
||||
var posts = await client.GetStringAsync(new Uri("/posts", UriKind.Relative));
|
||||
posts.ShouldContain("Beiträge"); // heading from the page title
|
||||
WebUtility.HtmlDecode(posts).ShouldContain("Beiträge"); // heading from the page title; the "ä" is encoded
|
||||
posts.ShouldContain("Neuigkeiten aus dem Elternbeirat."); // the page body
|
||||
|
||||
var events = await client.GetStringAsync(new Uri("/events", UriKind.Relative));
|
||||
@@ -375,8 +375,9 @@ public sealed partial class RouteSmokeTests : IDisposable
|
||||
|
||||
html.ShouldContain(">Willkommen</h1>");
|
||||
html.ShouldNotContain(">Elternbeirat der IGMH</h1>"); // the fallback title
|
||||
html.ShouldContain("""<a class="btn btn-primary" href="/events">""");
|
||||
html.ShouldContain("""<a class="btn btn-secondary" href="/contact">""");
|
||||
// Scoped CSS adds a b-… attribute after href, so the tag is not closed there.
|
||||
html.ShouldMatch("""<a class="btn btn-primary" href="/events"[\s>]""");
|
||||
html.ShouldMatch("""<a class="btn btn-secondary" href="/contact"[\s>]""");
|
||||
}
|
||||
|
||||
[Fact]
|
||||
@@ -441,7 +442,7 @@ public sealed partial class RouteSmokeTests : IDisposable
|
||||
var html = await client.GetStringAsync(new Uri("/events", UriKind.Relative));
|
||||
|
||||
Regex.Count(html, Regex.Escape("Sitzungen und Veranstaltungen auf einen Blick.")).ShouldBe(1);
|
||||
html.ShouldContain("""<a class="btn btn-secondary" href="/events.ics">""");
|
||||
html.ShouldMatch("""<a class="btn btn-secondary" href="/events.ics"[\s>]""");
|
||||
html.ShouldContain("Kalender abonnieren");
|
||||
}
|
||||
|
||||
@@ -450,14 +451,15 @@ public sealed partial class RouteSmokeTests : IDisposable
|
||||
{
|
||||
var client = _factory.CreateClient();
|
||||
|
||||
var html = await client.GetStringAsync(new Uri("/events", UriKind.Relative));
|
||||
// Decoded because the dash in "20.–22. Juli" is written as an entity.
|
||||
var html = WebUtility.HtmlDecode(await client.GetStringAsync(new Uri("/events", UriKind.Relative)));
|
||||
|
||||
var past = PastEvents().Match(html);
|
||||
past.Success.ShouldBeTrue();
|
||||
past.Value.ShouldContain("Vergangene Termine anzeigen (2)");
|
||||
past.Value.ShouldContain("Infoabend Klasse 5");
|
||||
past.Value.ShouldNotContain("Elternbeiratssitzung"); // upcoming, not past
|
||||
past.Value.ShouldContain("""<h3 class="past-events-year">2026</h3>""");
|
||||
past.Value.ShouldMatch("""<h3 class="past-events-year"[^>]*>2026</h3>""");
|
||||
past.Value.ShouldContain("10. September"); // day without weekday or year
|
||||
past.Value.ShouldContain("19:00 Uhr"); // the time stays, after the title
|
||||
past.Value.ShouldContain("20.–22. Juli"); // several days as a span
|
||||
|
||||
Reference in new issue
Block a user