config component render tests
This commit is contained in:
parent
ab60bccc1d
commit
b9e81650b3
60
src/PanoptesTest/ConfigTests.cs
Normal file
60
src/PanoptesTest/ConfigTests.cs
Normal file
@ -0,0 +1,60 @@
|
||||
using PanoptesFrontend.Data;
|
||||
using PanoptesFrontend.Pages;
|
||||
using PanoptesFrontend.Services;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
|
||||
public class ModuleConfigTests : TestContext
|
||||
{
|
||||
[Fact]
|
||||
public void ImageNameInputFieldIsPresent()
|
||||
{
|
||||
Services.AddSingleton<IHttpService, HttpService>();
|
||||
// Arrange
|
||||
using var ctx = new TestContext();
|
||||
ctx.Services.AddSingleton<IHttpService, HttpService>();
|
||||
var cut = ctx.RenderComponent<ModConfig>();
|
||||
|
||||
// Act
|
||||
var input = cut.Find("input[name='ImageName']");
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(input);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void EnvironmentVariableFormIsPresent()
|
||||
{
|
||||
Services.AddSingleton<IHttpService, HttpService>();
|
||||
// Arrange
|
||||
using var ctx = new TestContext();
|
||||
ctx.Services.AddSingleton<IHttpService, HttpService>();
|
||||
var cut = ctx.RenderComponent<ModConfig>();
|
||||
|
||||
// Act
|
||||
var envKey= cut.Find("input[name='env_key']");
|
||||
var envVal = cut.Find("input[name='env_val']");
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(envKey);
|
||||
Assert.NotNull(envVal);
|
||||
}
|
||||
|
||||
[Fact]
|
||||
public void VolumeFormIsPresent()
|
||||
{
|
||||
Services.AddSingleton<IHttpService, HttpService>();
|
||||
// Arrange
|
||||
using var ctx = new TestContext();
|
||||
ctx.Services.AddSingleton<IHttpService, HttpService>();
|
||||
var cut = ctx.RenderComponent<ModConfig>();
|
||||
|
||||
// Act
|
||||
var volKey= cut.Find("input[name='vol_key']");
|
||||
var volVal = cut.Find("input[name='vol_val']");
|
||||
|
||||
// Assert
|
||||
Assert.NotNull(volKey);
|
||||
Assert.NotNull(volVal);
|
||||
}
|
||||
}
|
||||
Loading…
x
Reference in New Issue
Block a user