diff --git a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs b/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs index 36a9dba..cd884d6 100644 --- a/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs +++ b/tests/ScadaLink.CentralUI.PlaywrightTests/Audit/AuditGridColumnTests.cs @@ -146,6 +146,14 @@ public class AuditGridColumnTests Assert.True(after > before + 40, $"Expected the {columnKey} column to widen after the resize drag (before={before}, after={after})."); + // The resize persists asynchronously: pointer-up fires a + // fire-and-forget JS→.NET OnColumnResized invoke, and the .NET + // handler then round-trips back through JS interop to write + // sessionStorage. Wait for that write to land before reloading — + // otherwise the reload races it and the restored grid falls back + // to the default width. + await WaitForStorageKeyAsync(page, "auditGrid:columnWidths"); + // Reload: the persisted width is restored from sessionStorage. await page.ReloadAsync(); await page.WaitForLoadStateAsync(LoadState.NetworkIdle);