Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -15,27 +15,29 @@
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in Forecasts)
{
<div class="table-responsive" tabindex="0" role="region" aria-label="Weather forecasts">
<table class="table">
<thead>
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
}
</tbody>
</table>
</thead>
<tbody>
@foreach (var forecast in Forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
</div>
}

@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,27 +13,29 @@
}
else
{
<table class="table">
<thead>
<tr>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<div class="table-responsive" tabindex="0" role="region" aria-label="Weather forecasts">
<table class="table">
<thead>
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
<th>Date</th>
<th aria-label="Temperature in Celsius">Temp. (C)</th>
<th aria-label="Temperature in Fahrenheit">Temp. (F)</th>
<th>Summary</th>
</tr>
}
</tbody>
</table>
</thead>
<tbody>
@foreach (var forecast in forecasts)
{
<tr>
<td>@forecast.Date.ToShortDateString()</td>
<td>@forecast.TemperatureC</td>
<td>@forecast.TemperatureF</td>
<td>@forecast.Summary</td>
</tr>
}
</tbody>
</table>
</div>
}

@code {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -82,6 +82,17 @@ public static bool TryValidateBrowserRequired(BrowserKind browserKind, bool isRe
return isRequired;
}

protected async Task AssertWeatherDoesNotOverflowAtNarrowViewportAsync(BrowserKind browserKind, string listeningUri)
{
await using var browser = await BrowserManager.GetBrowserInstance(browserKind, BrowserContextInfo);
var page = await browser.NewPageAsync();
await page.SetViewportSizeAsync(320, 800);
await page.GotoAsync($"{listeningUri.TrimEnd('/')}/weather");
await page.WaitForFunctionAsync("() => document.querySelectorAll('article table>tbody>tr').length === 5");
var documentWidth = await page.EvaluateAsync<int>("document.documentElement.scrollWidth");
Assert.True(documentWidth <= 320, $"Weather document width was {documentWidth}px at a 320px viewport.");
}

protected async Task TestBasicInteractionInNewPageAsync(
BrowserKind browserKind,
string listeningUri,
Expand Down Expand Up @@ -296,7 +307,7 @@ await page.EvaluateAsync("""

// Asynchronously loads and displays the table of weather forecasts
await page.WaitForSelectorAsync("table>tbody>tr");
Assert.Equal(5, await page.Locator("p+table>tbody>tr").CountAsync());
Assert.Equal(5, await page.Locator("article table>tbody>tr").CountAsync());
}

if (!pagesToExclude.HasFlag(BlazorTemplatePages.Home))
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,24 @@ public async Task BlazorWasmStandaloneTemplate_Works(BrowserKind browserKind)
}
}

[Theory]
[InlineData(BrowserKind.Chromium)]
public async Task BlazorWasmStandaloneTemplate_WeatherDoesNotOverflowAtNarrowViewport(BrowserKind browserKind)

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The new standalone WebAssembly regression test is added under the class-level [QuarantinedTest], so it inherits Quarantined=true and is excluded from ordinary test runs. The separate non-quarantined test exercises the blazor -int Server template, not this blazorwasm template, leaving the WebAssembly fix without gating coverage. Please narrow or remove the class quarantine (or otherwise provide stable non-quarantined coverage) so this regression test runs in the normal test path.

Human-directed and GitHub Copilot-generated.

{
if (!BrowserManager.IsAvailable(browserKind))
{
EnsureBrowserAvailable(browserKind);
return;
}

var project = await CreateBuildPublishAsync();
var (serveProcess, listeningUri) = project.ServePublishedStandaloneApp(Output);
using (serveProcess)
{
await AssertWeatherDoesNotOverflowAtNarrowViewportAsync(browserKind, listeningUri);
}
}

[Theory]
[InlineData(BrowserKind.Chromium)]
public async Task BlazorWasmStandalonePwaTemplate_Works(BrowserKind browserKind)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,21 @@ Project GetTargetProject(Project rootProject)
}
}

[Theory]
[InlineData(BrowserKind.Chromium)]
public async Task BlazorWebTemplate_WeatherDoesNotOverflowAtNarrowViewport(BrowserKind browserKind)
{
if (!BrowserManager.IsAvailable(browserKind))
{
EnsureBrowserAvailable(browserKind);
return;
}

var project = await CreateBuildPublishAsync(args: ["-int", "Server"]);
using var aspNetProcess = project.StartPublishedProjectAsync();
await AssertWeatherDoesNotOverflowAtNarrowViewportAsync(browserKind, aspNetProcess.ListeningUri.AbsoluteUri);
}

[Theory]
[InlineData(BrowserKind.Chromium)]
public async Task BlazorWebTemplate_CanUsePasskeys(BrowserKind browserKind)
Expand Down
Loading