Skip to content

Commit

Permalink
Tooltip component test is added
Browse files Browse the repository at this point in the history
  • Loading branch information
Gokce Ozkan committed Oct 21, 2024
1 parent 60f66b7 commit a4d878e
Show file tree
Hide file tree
Showing 2 changed files with 41 additions and 2 deletions.
39 changes: 39 additions & 0 deletions SiemensIXBlazor.Tests/TooltipTest.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
// -----------------------------------------------------------------------
// 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 Microsoft.AspNetCore.Components;
using SiemensIXBlazor.Components;
using SiemensIXBlazor.Enums.Tooltip;
using Xunit;

namespace SiemensIXBlazor.Tests
{
public class TooltipTests : TestContextBase
{
[Fact]
public void TooltipRendersCorrectly()
{
// Arrange
var cut = RenderComponent<Tooltip>(
("Id", "tooltipId"),
("TitleContent", "Test Tooltip"),
("Interactive", true),
("Placement", TooltipVariant.bottom),
("For", "testElement")
);

// Assert
cut.MarkupMatches("<ix-tooltip id=\"tooltipId\" title-content=\"Test Tooltip\" interactive placement=\"bottom\" for=\"testElement\"></ix-tooltip>");
}


}
}
4 changes: 2 additions & 2 deletions SiemensIXBlazor/Components/Tooltip/Tooltip.razor
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,8 @@
<ix-tooltip @attributes="UserAttributes"
id="@Id"
placement="@Placement"
titleContent="@TitleContent"
interactive="Interactive"
title-content="@TitleContent"
interactive="@Interactive"
for="@For"
style="@Style"
class="@Class">
Expand Down

0 comments on commit a4d878e

Please sign in to comment.