From 191097cd41d269fe5f04a9d146b8357e6a5957bb Mon Sep 17 00:00:00 2001 From: Alexander van Delft Date: Thu, 5 Dec 2024 16:46:38 +0100 Subject: [PATCH] Ugrade Bunit becuse of transitive vulnerability and bump CDP4-COMET-SDK to 27.4.1 --- .../COMET.Web.Common.Test.csproj | 2 +- .../COMET.Web.Common.Tests.csproj | 2 +- COMET.Web.Common/COMET.Web.Common.csproj | 4 +-- COMETwebapp.Tests/COMETwebapp.Tests.csproj | 2 +- .../ModelDashboardTestFixture.cs | 25 ++++++++++--------- .../ParameterEditorTestFixture.cs | 17 +++++++++---- .../Pages/Viewer/ViewerTestFixture.cs | 17 +++++++++---- 7 files changed, 42 insertions(+), 27 deletions(-) diff --git a/COMET.Web.Common.Test/COMET.Web.Common.Test.csproj b/COMET.Web.Common.Test/COMET.Web.Common.Test.csproj index d2ae6fbe..8088b80e 100644 --- a/COMET.Web.Common.Test/COMET.Web.Common.Test.csproj +++ b/COMET.Web.Common.Test/COMET.Web.Common.Test.csproj @@ -28,7 +28,7 @@ - + diff --git a/COMET.Web.Common.Tests/COMET.Web.Common.Tests.csproj b/COMET.Web.Common.Tests/COMET.Web.Common.Tests.csproj index 8c64447d..b616db34 100644 --- a/COMET.Web.Common.Tests/COMET.Web.Common.Tests.csproj +++ b/COMET.Web.Common.Tests/COMET.Web.Common.Tests.csproj @@ -46,7 +46,7 @@ - + diff --git a/COMET.Web.Common/COMET.Web.Common.csproj b/COMET.Web.Common/COMET.Web.Common.csproj index 36303baf..4eb65777 100644 --- a/COMET.Web.Common/COMET.Web.Common.csproj +++ b/COMET.Web.Common/COMET.Web.Common.csproj @@ -31,8 +31,8 @@ - - + + diff --git a/COMETwebapp.Tests/COMETwebapp.Tests.csproj b/COMETwebapp.Tests/COMETwebapp.Tests.csproj index f90bfa7f..2b4f74df 100644 --- a/COMETwebapp.Tests/COMETwebapp.Tests.csproj +++ b/COMETwebapp.Tests/COMETwebapp.Tests.csproj @@ -15,7 +15,7 @@ - + diff --git a/COMETwebapp.Tests/Pages/ModelDashboard/ModelDashboardTestFixture.cs b/COMETwebapp.Tests/Pages/ModelDashboard/ModelDashboardTestFixture.cs index 64b692c1..283dbab0 100644 --- a/COMETwebapp.Tests/Pages/ModelDashboard/ModelDashboardTestFixture.cs +++ b/COMETwebapp.Tests/Pages/ModelDashboard/ModelDashboardTestFixture.cs @@ -172,27 +172,28 @@ public async Task VerifyIterationSelection() public void VerifyIterationPreselection() { this.openedIterations.AddRange(new List { this.firstIteration }); - - this.context.RenderComponent(parameters => - { - parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid()); - }); - var navigation = this.context.Services.GetService(); + var navigationManager = this.context.Services.GetRequiredService(); + var testUri = $"/ModelDashboard?IterationId={this.firstIteration.Iid.ToShortGuid()}"; + + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.Multiple(() => { Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); - Assert.That(navigation.Uri.Contains("server"), Is.True); - Assert.That(navigation.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); + Assert.That(navigationManager.Uri.Contains("server"), Is.True); + Assert.That(navigationManager.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); }); this.viewModel.SelectedThing = null; - this.context.RenderComponent(parameters => - { - parameters.Add(p => p.IterationId, this.secondIteration.Iid.ToShortGuid()); - }); + testUri = $"/ModelDashboard?IterationId={this.secondIteration.Iid.ToShortGuid()}"; + + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); } diff --git a/COMETwebapp.Tests/Pages/ParameterEditor/ParameterEditorTestFixture.cs b/COMETwebapp.Tests/Pages/ParameterEditor/ParameterEditorTestFixture.cs index e01a4656..625085f9 100644 --- a/COMETwebapp.Tests/Pages/ParameterEditor/ParameterEditorTestFixture.cs +++ b/COMETwebapp.Tests/Pages/ParameterEditor/ParameterEditorTestFixture.cs @@ -162,20 +162,27 @@ public void VerifyIterationPreselection() { this.openedIterations.AddRange(new List { this.firstIteration }); - this.context.RenderComponent(parameters => { parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid()); }); + var navigationManager = this.context.Services.GetRequiredService(); + var testUri = $"/ParameterEditor?IterationId={this.firstIteration.Iid.ToShortGuid()}"; - var navigation = this.context.Services.GetService(); + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.Multiple(() => { Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); - Assert.That(navigation.Uri.Contains("server"), Is.True); - Assert.That(navigation.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); + Assert.That(navigationManager.Uri.Contains("server"), Is.True); + Assert.That(navigationManager.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); }); this.viewModel.SelectedThing = null; - this.context.RenderComponent(parameters => { parameters.Add(p => p.IterationId, this.secondIteration.Iid.ToShortGuid()); }); + testUri = $"/ParameterEditor?IterationId={this.secondIteration.Iid.ToShortGuid()}"; + + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); } diff --git a/COMETwebapp.Tests/Pages/Viewer/ViewerTestFixture.cs b/COMETwebapp.Tests/Pages/Viewer/ViewerTestFixture.cs index 54fb6dba..b0969c62 100644 --- a/COMETwebapp.Tests/Pages/Viewer/ViewerTestFixture.cs +++ b/COMETwebapp.Tests/Pages/Viewer/ViewerTestFixture.cs @@ -151,20 +151,27 @@ public void VerifyIterationPreselection() { this.openedIterations.AddRange(new List { this.firstIteration }); - this.context.RenderComponent(parameters => { parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid()); }); + var navigationManager = this.context.Services.GetRequiredService(); + var testUri = $"/Viewer?IterationId={this.firstIteration.Iid.ToShortGuid()}"; - var navigation = this.context.Services.GetService(); + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.Multiple(() => { Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); - Assert.That(navigation.Uri.Contains("server"), Is.True); - Assert.That(navigation.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); + Assert.That(navigationManager.Uri.Contains("server"), Is.True); + Assert.That(navigationManager.Uri.Contains(this.firstIteration.Iid.ToShortGuid()), Is.True); }); this.viewModel.SelectedThing = null; - this.context.RenderComponent(parameters => { parameters.Add(p => p.IterationId, this.secondIteration.Iid.ToShortGuid()); }); + testUri = $"/Viewer?IterationId={this.secondIteration.Iid.ToShortGuid()}"; + + // Act: Navigate to the URI and render the component + navigationManager.NavigateTo(testUri); + this.context.RenderComponent(); Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration)); }