-
Notifications
You must be signed in to change notification settings - Fork 13
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #103 from emregokrem/master
- Loading branch information
Showing
8 changed files
with
170 additions
and
71 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
// ----------------------------------------------------------------------- | ||
// SPDX-FileCopyrightText: 2024 Siemens AG | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
// ----------------------------------------------------------------------- | ||
|
||
using Bunit; | ||
using SiemensIXBlazor.Components; | ||
|
||
namespace SiemensIXBlazor.Tests.Dropdown | ||
{ | ||
public class DropdownHeaderTests : TestContextBase | ||
{ | ||
[Fact] | ||
public void DropdownHeaderRendersWithoutCrashing() | ||
{ | ||
// Arrange | ||
var cut = RenderComponent<DropdownHeader>(parameters => { | ||
parameters.Add(p => p.Label, "testLabel"); | ||
}); | ||
|
||
// Assert | ||
cut.MarkupMatches("<ix-dropdown-header label='testLabel'></ix-dropdown-header>"); | ||
} | ||
|
||
[Fact] | ||
public void DropdownHeaderRendersChildContent() | ||
{ | ||
// Arrange | ||
var expectedContent = "Expected content"; | ||
|
||
// Act | ||
var cut = RenderComponent<DropdownHeader>(parameters => parameters | ||
.Add(p => p.ChildContent, builder => | ||
{ | ||
builder.AddContent(0, expectedContent); | ||
})); | ||
|
||
// Assert | ||
Assert.Contains(expectedContent, cut.Markup); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
@* ----------------------------------------------------------------------- | ||
// SPDX-FileCopyrightText: 2024 Siemens AG | ||
// | ||
// SPDX-License-Identifier: MIT | ||
// | ||
// This source code is licensed under the MIT license found in the | ||
// LICENSE file in the root directory of this source tree. | ||
// ----------------------------------------------------------------------- | ||
*@ | ||
|
||
@namespace SiemensIXBlazor.Components | ||
@inherits IXBaseComponent | ||
|
||
<ix-dropdown-header @attributes="UserAttributes" | ||
label="@Label" | ||
style="@Style" | ||
class="@Class"> | ||
@ChildContent | ||
</ix-dropdown-header> | ||
|
11 changes: 11 additions & 0 deletions
11
SiemensIXBlazor/Components/Dropdown/DropdownHeader.razor.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,11 @@ | ||
using Microsoft.AspNetCore.Components; | ||
|
||
namespace SiemensIXBlazor.Components; | ||
|
||
public partial class DropdownHeader | ||
{ | ||
[Parameter] | ||
public string? Label { get; set; } | ||
[Parameter] | ||
public RenderFragment? ChildContent { get; set; } | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
126 changes: 63 additions & 63 deletions
126
SiemensIXBlazor/SiemensIXBlazor_NpmJS/package-lock.json
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
cd SiemensIXBlazor_NpmJS | ||
npm install && npm run build |