diff --git a/src/AzureIoTHub.Portal.Client/Pages/EdgeDevices/EdgeDeviceListPage.razor b/src/AzureIoTHub.Portal.Client/Pages/EdgeDevices/EdgeDeviceListPage.razor index 8a3539022..dc35333dc 100644 --- a/src/AzureIoTHub.Portal.Client/Pages/EdgeDevices/EdgeDeviceListPage.razor +++ b/src/AzureIoTHub.Portal.Client/Pages/EdgeDevices/EdgeDeviceListPage.razor @@ -88,7 +88,7 @@ Device ID Allowed - Nb devices + Nb devices See details Delete diff --git a/src/AzureIoTHub.Portal.Client/Pages/EdgeModels/EdgeModelListPage.razor b/src/AzureIoTHub.Portal.Client/Pages/EdgeModels/EdgeModelListPage.razor index 222024232..f951dfd8f 100644 --- a/src/AzureIoTHub.Portal.Client/Pages/EdgeModels/EdgeModelListPage.razor +++ b/src/AzureIoTHub.Portal.Client/Pages/EdgeModels/EdgeModelListPage.razor @@ -31,8 +31,8 @@ - Name - Description + Name + Description Details Delete diff --git a/src/AzureIoTHub.Portal.Tests.Unit/Client/Pages/EdgeModels/EdgeModelsListPageTest.cs b/src/AzureIoTHub.Portal.Tests.Unit/Client/Pages/EdgeModels/EdgeModelsListPageTest.cs index efae56ad4..63d499516 100644 --- a/src/AzureIoTHub.Portal.Tests.Unit/Client/Pages/EdgeModels/EdgeModelsListPageTest.cs +++ b/src/AzureIoTHub.Portal.Tests.Unit/Client/Pages/EdgeModels/EdgeModelsListPageTest.cs @@ -204,5 +204,40 @@ public void ClickOnDeleteShouldDisplayConfirmationDialogAndReloadDeviceModelIfCo cut.WaitForAssertion(() => this.mockEdgeModelServiceClient.Verify(service => service.GetIoTEdgeModelList(), Times.Exactly(2))); cut.WaitForAssertion(() => MockRepository.VerifyAll()); } + + [Test] + public void ClickOnSortLabel() + { + // Arrange + _ = this.mockEdgeModelServiceClient.Setup(x => x.GetIoTEdgeModelList()) + .ReturnsAsync(new List() + { + new IoTEdgeModelListItem() + { + ModelId = Guid.NewGuid().ToString(), + Name = Guid.NewGuid().ToString() + }, + new IoTEdgeModelListItem() + { + ModelId = Guid.NewGuid().ToString(), + Name = Guid.NewGuid().ToString() + }, + }); + + // Act + var cut = RenderComponent(); + + cut.WaitForAssertion(() => cut.WaitForElement("#NameLabel").Should().NotBeNull()); + var sortNameButtons = cut.WaitForElement("#NameLabel"); + sortNameButtons.Click(); + + cut.WaitForAssertion(() => cut.WaitForElement("#DescriptionLabel").Should().NotBeNull()); + var sortDescriptionButtons = cut.WaitForElement("#DescriptionLabel"); + sortDescriptionButtons.Click(); + + // Assert + cut.WaitForAssertion(() => Assert.AreEqual(3, cut.FindAll("tr").Count)); + cut.WaitForAssertion(() => MockRepository.VerifyAll()); + } } }