Skip to content

Commit

Permalink
Feature/870 edge models creation/edition page (#892)
Browse files Browse the repository at this point in the history
* edge model create page

* implement create edge device model page

* implement Service for edgeModel, EdgeModelListPage, EdgeModel creation page and edge model controller

* create edgeModel mapper

* test module content format

* change properties name

* moduleContent : doesn't work

* model change

* edge model create page

* implement create edge device model page

* implement Service for edgeModel, EdgeModelListPage, EdgeModel creation page and edge model controller

* create edgeModel mapper

* edge device model edition page

* add edgemodule mapper

* task: module and environment variable

* delete useless files and refactoring

* delete unused file

* create unit test for edgeModelClientService

* add edgeModelController unit test.

* add edgeModelMapper unit test

* resolve code scanning issues

* fix code scanning issues

* add some test for configService

* fix module dialog unit test

* add update edge model

* add configHelper test.

* add unit test on edgeModelServiceTest

* delete useless test

* add new test on EdgeModelClientServiceTest

* add new unit test on EdgeModelsControllerTest

* add new test on configServiceTest

* add new test

* add test on edgeModelsListPageTest

* add new test on edgeModelListPage

* fix error

* fix code scanning alert

* add test on createEdgeModelPage

* Bug fix #1080 and bug fix #1083

* add unit test on deleteEdgeModelDialog

* add new test on createEdgeModelPage

* add new test on edgeModelService

* add EdgeModelDetailPage unit test

* add new test to ConfigHelpers

* fix unit test

* fix bug: Edge Model Edition - When adding a new module, module name and uri text box not available

* remove udeless code

* resizing moduleDialog
  • Loading branch information
Sben65 authored Aug 19, 2022
1 parent 2e66159 commit 91e4499
Show file tree
Hide file tree
Showing 51 changed files with 4,438 additions and 778 deletions.

This file was deleted.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -24,13 +24,14 @@ public async Task ModuleDialogTestMustBeRenderedOnShow()
{
//Arrange
var moduleName = Guid.NewGuid().ToString();
var moduleVersion = Guid.NewGuid().ToString();
var moduleImageUri = Guid.NewGuid().ToString();

var module = new IoTEdgeModule()
{
ModuleName = moduleName,
Version = moduleVersion,
Version = "1.0",
Status = "running",
ImageURI = moduleImageUri,
EnvironmentVariables = new List<IoTEdgeModuleEnvironmentVariable>(),
ModuleIdentityTwinSettings = new List<IoTEdgeModuleTwinSetting>(),
Commands = new List<IoTEdgeModuleCommand>()
Expand All @@ -51,7 +52,7 @@ public async Task ModuleDialogTestMustBeRenderedOnShow()

cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ModuleName)}").OuterHtml.Should().Contain(moduleName));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.Version)}").OuterHtml.Should().Contain(moduleVersion));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ImageURI)}").OuterHtml.Should().Contain(moduleImageUri));

// Assert
var tabs = cut.WaitForElements(".mud-tabs .mud-tab");
Expand All @@ -67,12 +68,14 @@ public async Task ClickOnSubmitShouldUpdateModuleValues()
//Arrange
var moduleName = Guid.NewGuid().ToString();
var moduleVersion = Guid.NewGuid().ToString();
var moduleImageUri = Guid.NewGuid().ToString();

var module = new IoTEdgeModule()
{
ModuleName = moduleName,
Version = moduleVersion,
Status = "running",
ImageURI = moduleImageUri,
EnvironmentVariables = new List<IoTEdgeModuleEnvironmentVariable>(),
ModuleIdentityTwinSettings = new List<IoTEdgeModuleTwinSetting>(),
Commands = new List<IoTEdgeModuleCommand>()
Expand All @@ -94,13 +97,13 @@ public async Task ClickOnSubmitShouldUpdateModuleValues()
cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());

cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ModuleName)}").Change("newModuleNameValue"));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.Version)}").Change("newModuleVersionValue"));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ImageURI)}").Change("newModuleImageUriValue"));

var submitButton = cut.WaitForElement("#SubmitButton");
submitButton.Click();

cut.WaitForAssertion(() => module.ModuleName.Should().Be("newModuleNameValue"));
cut.WaitForAssertion(() => module.Version.Should().Be("newModuleVersionValue"));
cut.WaitForAssertion(() => module.ImageURI.Should().Be("newModuleImageUriValue"));
}

[Test]
Expand All @@ -109,12 +112,14 @@ public async Task ClickOnCancelShouldNotChangeModuleValues()
//Arrange
var moduleName = Guid.NewGuid().ToString();
var moduleVersion = Guid.NewGuid().ToString();
var moduleImageUri = Guid.NewGuid().ToString();

var module = new IoTEdgeModule()
{
ModuleName = moduleName,
Version = moduleVersion,
Status = "running",
ImageURI = moduleImageUri,
EnvironmentVariables = new List<IoTEdgeModuleEnvironmentVariable>(),
ModuleIdentityTwinSettings = new List<IoTEdgeModuleTwinSetting>(),
Commands = new List<IoTEdgeModuleCommand>()
Expand All @@ -136,13 +141,13 @@ public async Task ClickOnCancelShouldNotChangeModuleValues()
cut.WaitForAssertion(() => cut.Find("div.mud-dialog-container").Should().NotBeNull());

cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ModuleName)}").Change("newModuleNameValue"));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.Version)}").Change("newModuleVersionValue"));
cut.WaitForAssertion(() => cut.Find($"#{nameof(IoTEdgeModule.ImageURI)}").Change("newModuleImageUriValue"));

var cancelButton = cut.WaitForElement("#CancelButton");
cancelButton.Click();

cut.WaitForAssertion(() => module.ModuleName.Should().Be(moduleName));
cut.WaitForAssertion(() => module.Version.Should().Be(moduleVersion));
cut.WaitForAssertion(() => module.ImageURI.Should().Be(moduleImageUri));
}
}
}
Loading

0 comments on commit 91e4499

Please sign in to comment.