|
| 1 | +// Licensed to the .NET Foundation under one or more agreements. |
| 2 | +// The .NET Foundation licenses this file to you under the Apache 2.0 License |
| 3 | +// See the LICENSE file in the project root for more information. |
| 4 | +// Maintainer: Argo Zhang([email protected]) Website: https://www.blazor.zone |
| 5 | + |
| 6 | +namespace UnitTest.Components; |
| 7 | + |
| 8 | +public class ShieldBadgeTest : BootstrapBlazorTestBase |
| 9 | +{ |
| 10 | + [Fact] |
| 11 | + public void ShieldBadge_Ok() |
| 12 | + { |
| 13 | + var cut = Context.RenderComponent<ShieldBadge>(); |
| 14 | + cut.Contains("shield-badge"); |
| 15 | + cut.Contains("shield-badge-label"); |
| 16 | + cut.Contains("shield-badge-text"); |
| 17 | + cut.DoesNotContain("shield-badge-icon"); |
| 18 | + |
| 19 | + cut.SetParametersAndRender(p => p.Add(i => i.Icon, "fa fa-user")); |
| 20 | + cut.Contains("shield-badge-icon"); |
| 21 | + |
| 22 | + cut.SetParametersAndRender(p => p.Add(i => i.Label, "test-label")); |
| 23 | + cut.Contains("test-label"); |
| 24 | + |
| 25 | + cut.SetParametersAndRender(p => p.Add(i => i.Text, "test-text")); |
| 26 | + cut.Contains("test-text"); |
| 27 | + |
| 28 | + cut.SetParametersAndRender(p => p.Add(i => i.IconColor, "#123")); |
| 29 | + cut.Contains("--bb-shield-badge-icon-color: #123;"); |
| 30 | + |
| 31 | + cut.SetParametersAndRender(p => p.Add(i => i.LabelColor, "#123")); |
| 32 | + cut.Contains("--bb-shield-badge-label-color: #123;"); |
| 33 | + |
| 34 | + cut.SetParametersAndRender(p => p.Add(i => i.LabelBackgroundColor, "#123")); |
| 35 | + cut.Contains("--bb-shield-badge-label-bg: #123;"); |
| 36 | + |
| 37 | + cut.SetParametersAndRender(p => p.Add(i => i.TextColor, "#123")); |
| 38 | + cut.Contains("--bb-shield-badge-text-color: #123;"); |
| 39 | + |
| 40 | + cut.SetParametersAndRender(p => p.Add(i => i.TextBackgroundColor, "#123")); |
| 41 | + cut.Contains("--bb-shield-badge-text-bg: #123;"); |
| 42 | + |
| 43 | + cut.SetParametersAndRender(p => p.Add(i => i.Radius, 4)); |
| 44 | + cut.Contains("--bb-shield-badge-radius: 4px;"); |
| 45 | + } |
| 46 | +} |
0 commit comments