Skip to content
Merged
Changes from 1 commit
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
Prev Previous commit
Next Next commit
Refactor DataGrid ARIA tests to re-query DOM after rerenders
  • Loading branch information
versile2 committed Mar 27, 2026
commit e4c1834e70469709b0fe413282af918d72bf0d52
10 changes: 5 additions & 5 deletions src/MudBlazor.UnitTests/Components/DataGridTests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -5294,23 +5294,23 @@ public async Task SelectColumn_SetsAriaSelectedOnRows()
}));

List<IElement> Rows() => comp.FindAll("tbody tr").ToList();
List<IElement> RowCheckboxes() => comp.FindAll("tbody .mud-checkbox input").ToList();
IElement HeaderCheckbox() => comp.Find("thead .mud-checkbox input");

Rows()[0].GetAttribute("aria-selected").Should().Be("false");
Rows()[1].GetAttribute("aria-selected").Should().Be("false");

var rowCheckboxes = comp.FindAll("tbody .mud-checkbox input");
await rowCheckboxes[0].ChangeAsync(true);
await RowCheckboxes()[0].ChangeAsync(true);

Rows()[0].GetAttribute("aria-selected").Should().Be("true");
Rows()[1].GetAttribute("aria-selected").Should().Be("false");

var headerCheckbox = comp.Find("thead .mud-checkbox input");
await headerCheckbox.ChangeAsync(true);
await HeaderCheckbox().ChangeAsync(true);

Rows()[0].GetAttribute("aria-selected").Should().Be("true");
Rows()[1].GetAttribute("aria-selected").Should().Be("true");

await headerCheckbox.ChangeAsync(false);
await HeaderCheckbox().ChangeAsync(false);

Rows()[0].GetAttribute("aria-selected").Should().Be("false");
Rows()[1].GetAttribute("aria-selected").Should().Be("false");
Expand Down
Loading