Skip to content

Commit

Permalink
Ugrade Bunit becuse of transitive vulnerability and bump CDP4-COMET-S…
Browse files Browse the repository at this point in the history
…DK to 27.4.1
  • Loading branch information
Alexander van Delft committed Dec 5, 2024
1 parent a428c72 commit 191097c
Show file tree
Hide file tree
Showing 7 changed files with 42 additions and 27 deletions.
2 changes: 1 addition & 1 deletion COMET.Web.Common.Test/COMET.Web.Common.Test.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="bunit.web" Version="1.26.64" />
<PackageReference Include="bunit.web" Version="1.36.0" />
<PackageReference Include="DevExpress.Blazor" Version="23.2.9" />
<PackageReference Include="Moq" Version="4.20.72" />
</ItemGroup>
Expand Down
2 changes: 1 addition & 1 deletion COMET.Web.Common.Tests/COMET.Web.Common.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
</ItemGroup>

<ItemGroup>
<PackageReference Include="bunit" Version="1.26.64" />
<PackageReference Include="bunit" Version="1.36.0" />
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
Expand Down
4 changes: 2 additions & 2 deletions COMET.Web.Common/COMET.Web.Common.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,8 +31,8 @@
<ItemGroup>
<PackageReference Include="AsyncEnumerator" Version="4.0.2" />
<PackageReference Include="Blazored.FluentValidation" Version="2.2.0" />
<PackageReference Include="CDP4ServicesDal-CE" Version="27.4.0" />
<PackageReference Include="CDP4Web-CE" Version="27.4.0" />
<PackageReference Include="CDP4ServicesDal-CE" Version="27.4.1" />
<PackageReference Include="CDP4Web-CE" Version="27.4.1" />
<PackageReference Include="DevExpress.Blazor" Version="23.2.9" />
<PackageReference Include="FluentResults" Version="3.16.0" />
<PackageReference Include="Microsoft.AspNetCore.Components.Authorization" Version="8.0.10" />
Expand Down
2 changes: 1 addition & 1 deletion COMETwebapp.Tests/COMETwebapp.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="bunit" Version="1.26.64" />
<PackageReference Include="bunit" Version="1.36.0" />
<PackageReference Include="DotNetSeleniumExtras.WaitHelpers" Version="3.11.0" />
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="17.11.1" />
<PackageReference Include="Moq" Version="4.20.72" />
Expand Down
25 changes: 13 additions & 12 deletions COMETwebapp.Tests/Pages/ModelDashboard/ModelDashboardTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -172,27 +172,28 @@ public async Task VerifyIterationSelection()
public void VerifyIterationPreselection()
{
this.openedIterations.AddRange(new List<Iteration> { this.firstIteration });

this.context.RenderComponent<ModelDashboard>(parameters =>
{
parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid());
});

var navigation = this.context.Services.GetService<NavigationManager>();
var navigationManager = this.context.Services.GetRequiredService<NavigationManager>();
var testUri = $"/ModelDashboard?IterationId={this.firstIteration.Iid.ToShortGuid()}";

// Act: Navigate to the URI and render the component
navigationManager.NavigateTo(testUri);
this.context.RenderComponent<ModelDashboard>();

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<ModelDashboard>(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<ModelDashboard>();

Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -162,20 +162,27 @@ public void VerifyIterationPreselection()
{
this.openedIterations.AddRange(new List<Iteration> { this.firstIteration });

this.context.RenderComponent<ParameterEditor>(parameters => { parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid()); });
var navigationManager = this.context.Services.GetRequiredService<NavigationManager>();
var testUri = $"/ParameterEditor?IterationId={this.firstIteration.Iid.ToShortGuid()}";

var navigation = this.context.Services.GetService<NavigationManager>();
// Act: Navigate to the URI and render the component
navigationManager.NavigateTo(testUri);
this.context.RenderComponent<ParameterEditor>();

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<ParameterEditor>(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<ParameterEditor>();

Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration));
}
Expand Down
17 changes: 12 additions & 5 deletions COMETwebapp.Tests/Pages/Viewer/ViewerTestFixture.cs
Original file line number Diff line number Diff line change
Expand Up @@ -151,20 +151,27 @@ public void VerifyIterationPreselection()
{
this.openedIterations.AddRange(new List<Iteration> { this.firstIteration });

this.context.RenderComponent<Viewer>(parameters => { parameters.Add(p => p.IterationId, this.firstIteration.Iid.ToShortGuid()); });
var navigationManager = this.context.Services.GetRequiredService<NavigationManager>();
var testUri = $"/Viewer?IterationId={this.firstIteration.Iid.ToShortGuid()}";

var navigation = this.context.Services.GetService<NavigationManager>();
// Act: Navigate to the URI and render the component
navigationManager.NavigateTo(testUri);
this.context.RenderComponent<Viewer>();

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<Viewer>(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<Viewer>();

Assert.That(this.viewModel.SelectedThing, Is.EqualTo(this.firstIteration));
}
Expand Down

0 comments on commit 191097c

Please sign in to comment.