Skip to content

Commit

Permalink
Hide custom properties fields in lora device model (#454)
Browse files Browse the repository at this point in the history
  • Loading branch information
kbeaugrand authored Mar 13, 2022
1 parent 2780adc commit 0cab54f
Show file tree
Hide file tree
Showing 7 changed files with 75 additions and 384 deletions.

This file was deleted.

Original file line number Diff line number Diff line change
Expand Up @@ -101,29 +101,7 @@ public void ClickOnSaveShouldPostDeviceModelData()
})
.RespondText(string.Empty);

_ = this.mockHttpClient
.When(HttpMethod.Post, $"{apiBaseUrl}/properties")
.With(m =>
{
Assert.IsAssignableFrom<JsonContent>(m.Content);
var jsonContent = m.Content as JsonContent;

Assert.IsAssignableFrom<List<DeviceProperty>>(jsonContent.Value);
var properties = jsonContent.Value as IEnumerable<DeviceProperty>;

Assert.AreEqual(expectedProperties.Length, properties.Count());

foreach (var expectedProperty in expectedProperties)
{
var property = properties.Single(x => x.Name == expectedProperty.Name);

Assert.AreEqual(expectedProperty.Name, property.Name);
Assert.AreEqual(expectedProperty.DisplayName, property.DisplayName);
Assert.AreEqual(expectedProperty.PropertyType, property.PropertyType);
}

return true;
})
_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl }/*/properties")
.RespondText(string.Empty);

var cut = RenderComponent<CreateDeviceModelPage>();
Expand Down Expand Up @@ -152,7 +130,7 @@ public void ClickOnAddPropertyShouldAddNewProperty()

_ = testContext.Services.AddSingleton(new PortalSettings { IsLoRaSupported = false });

_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl}/properties")
_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl }/*/properties")
.With(m =>
{
Assert.IsAssignableFrom<JsonContent>(m.Content);
Expand Down Expand Up @@ -209,10 +187,10 @@ public void ClickOnRemovePropertyShouldRemoveTheProperty()

_ = testContext.Services.AddSingleton(new PortalSettings { IsLoRaSupported = false });

_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl}")
_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl }")
.RespondText(string.Empty);

_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl}/properties")
_ = this.mockHttpClient.When(HttpMethod.Post, $"{ apiBaseUrl }/*/properties")
.With(m =>
{
Assert.IsAssignableFrom<JsonContent>(m.Content);
Expand Down
10 changes: 9 additions & 1 deletion src/AzureIoTHub.Portal/Client/AzureIoTHub.Portal.Client.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,15 @@
<UpToDateCheckInput Include="wwwroot/scss/**/*.scss" Set="Css" />
<UpToDateCheckBuilt Include="wwwroot/css/*.css" Set="Css" />
</ItemGroup>

<ItemGroup>
<Compile Remove="Pages\LoRaWAN\DeviceModels\**" />
<Content Remove="Pages\LoRaWAN\DeviceModels\**" />
<EmbeddedResource Remove="Pages\LoRaWAN\DeviceModels\**" />
<None Remove="Pages\LoRaWAN\DeviceModels\**" />
<UpToDateCheckBuilt Remove="Pages\LoRaWAN\DeviceModels\**" />
<UpToDateCheckInput Remove="Pages\LoRaWAN\DeviceModels\**" />
</ItemGroup>

<ItemGroup>
<Content Remove="compilerconfig.json" />
Expand All @@ -39,7 +48,6 @@
</ItemGroup>

<ItemGroup>
<Folder Include="Pages\LoRaWAN\DeviceModels\" />
<Folder Include="wwwroot\css\" />
<Folder Include="wwwroot\js\" />
</ItemGroup>
Expand Down
Loading

0 comments on commit 0cab54f

Please sign in to comment.