added tests for module management page
This commit is contained in:
parent
68aebf085e
commit
6ff59b5f8a
@ -7,7 +7,7 @@ using System.Net.Http;
|
|||||||
public class ModuleConfigTests : TestContext
|
public class ModuleConfigTests : TestContext
|
||||||
{
|
{
|
||||||
[Fact]
|
[Fact]
|
||||||
public void ImageNameInputFieldIsPresent()
|
public void NameInputFieldIsPresent()
|
||||||
{
|
{
|
||||||
Services.AddSingleton<IHttpService, HttpService>();
|
Services.AddSingleton<IHttpService, HttpService>();
|
||||||
// Arrange
|
// Arrange
|
||||||
@ -16,7 +16,55 @@ public class ModuleConfigTests : TestContext
|
|||||||
var cut = ctx.RenderComponent<ModConfig>();
|
var cut = ctx.RenderComponent<ModConfig>();
|
||||||
|
|
||||||
// Act
|
// Act
|
||||||
var input = cut.Find("input[name='ImageName']");
|
var input = cut.Find("input[name='name']");
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.NotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void ImageInputFieldIsPresent()
|
||||||
|
{
|
||||||
|
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='image']");
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.NotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void UserInputFieldIsPresent()
|
||||||
|
{
|
||||||
|
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='user']");
|
||||||
|
|
||||||
|
// Assert
|
||||||
|
Assert.NotNull(input);
|
||||||
|
}
|
||||||
|
|
||||||
|
[Fact]
|
||||||
|
public void InternalInputFieldIsPresent()
|
||||||
|
{
|
||||||
|
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='internal']");
|
||||||
|
|
||||||
// Assert
|
// Assert
|
||||||
Assert.NotNull(input);
|
Assert.NotNull(input);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user