chore(theme): bump ZB.MOM.WW.Theme 0.3.0 -> 0.3.1 (interactive-render nav fix)
This commit is contained in:
@@ -107,13 +107,19 @@ public class PlaywrightFixture : IAsyncLifetime
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Expand every collapsed sidebar nav section. Nav sections are collapsed by
|
||||
/// default, so a section's links are not in the DOM until it is expanded.
|
||||
/// Call this after authenticating, before interacting with sectioned nav links.
|
||||
/// Expand every collapsed sidebar nav section so its links are visible and
|
||||
/// clickable. The ZB.MOM.WW.Theme kit renders each section as a native
|
||||
/// <c><details class="rail-section"></c> whose <c><summary
|
||||
/// class="rail-eyebrow-toggle"></c> carries an <c>aria-expanded</c> attribute
|
||||
/// (rendered from the section's open state at SSR time and kept in sync by the
|
||||
/// kit's nav-state.js). Sections are expanded by default, but a section the user
|
||||
/// previously collapsed is restored collapsed from localStorage — its links stay
|
||||
/// in the DOM but are hidden until the section is expanded. Call this after
|
||||
/// authenticating, before interacting with sectioned nav links.
|
||||
/// </summary>
|
||||
public static async Task ExpandAllNavSectionsAsync(IPage page)
|
||||
{
|
||||
var toggles = page.Locator("button.nav-section-toggle");
|
||||
var toggles = page.Locator("summary.rail-eyebrow-toggle");
|
||||
int count = await toggles.CountAsync();
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
@@ -121,8 +127,9 @@ public class PlaywrightFixture : IAsyncLifetime
|
||||
if (await toggle.GetAttributeAsync("aria-expanded") == "false")
|
||||
{
|
||||
await toggle.ClickAsync();
|
||||
// Wait for the toggle's own state to flip so the Blazor
|
||||
// re-render has landed before moving to the next section.
|
||||
// Wait for the section's own state to flip (the kit's nav-state.js
|
||||
// mirrors the native <details open> onto aria-expanded) before
|
||||
// moving to the next section.
|
||||
await Assertions.Expect(toggle).ToHaveAttributeAsync("aria-expanded", "true");
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user