Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
Add animation class to FluentMessageBar and new test
Enhanced the FluentMessageBar component by adding the
`fluent-messagebar-animation` class to `div` elements with the
`fluent-messagebar` class across multiple test files. Updated
`FluentMessageBar_AllowDismiss.verified.html`,
`FluentMessageBar_Default.verified.html`,
`FluentMessageBar_DisableFadeIn.verified.html`, and
`FluentMessageBar_WithId.verified.html` to reflect this change.

Added a new `div` structure for the `fluent-messagebar` in
`FluentMessageBarTests.FluentMessageBar_DisableFadeIn.verified.html`.

Introduced a new test method `FluentMessageBar_DisableFadeIn` in
`FluentMessageBarTests.cs` to verify the component's behavior with
the `FadeIn` parameter set to `false`.

Included MIT License and copyright information at the top of
`FluentMessageBarTests.cs`.
  • Loading branch information
Yop Spanjers committed Sep 25, 2024
commit a2845da76bdd7b61d4fff286d53b0a3dd5ea0af1
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="fluent-messagebar intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-ig2qs97tvl="">
<div class="fluent-messagebar fluent-messagebar-animation intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-ig2qs97tvl="">
<div class="fluent-messagebar-icon" b-ig2qs97tvl="">
<svg style="width: 20px; fill: var(--info);" focusable="false" viewBox="0 0 20 20" aria-hidden="true" blazor:onclick="3">
<title>info</title>
Expand All @@ -10,4 +10,4 @@
<span class="title" b-ig2qs97tvl="">This is a message</span>
</div>
<div class="fluent-messagebar-container-action" b-ig2qs97tvl=""></div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

<div class="fluent-messagebar intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-5ykbiib3u4="">
<div class="fluent-messagebar fluent-messagebar-animation intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-5ykbiib3u4="">
<div class="fluent-messagebar-icon" b-5ykbiib3u4="">
<svg style="width: 20px; fill: var(--info);" focusable="false" viewBox="0 0 20 20" aria-hidden="true" blazor:onclick="3">
<title>info</title>
Expand All @@ -14,4 +14,4 @@
<path d="m2.59 2.72.06-.07a.5.5 0 0 1 .63-.06l.07.06L8 7.29l4.65-4.64a.5.5 0 0 1 .7.7L8.71 8l4.64 4.65c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L8 8.71l-4.65 4.64a.5.5 0 0 1-.7-.7L7.29 8 2.65 3.35a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"></path>
</svg>
</div>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@

<div class="fluent-messagebar intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-ig2qs97tvl="">
<div class="fluent-messagebar-icon" b-ig2qs97tvl="">
<svg style="width: 20px; fill: var(--info);" focusable="false" viewBox="0 0 20 20" aria-hidden="true" blazor:onkeydown="3" blazor:onclick="4">
<title>info</title>
<path d="M18 10a8 8 0 1 0-16 0 8 8 0 0 0 16 0ZM9.5 8.91a.5.5 0 0 1 1 0V13.6a.5.5 0 0 1-1 0V8.9Zm-.25-2.16a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Z"></path>
</svg>
</div>
<div class="fluent-messagebar-message" b-ig2qs97tvl="">
<span class="title" b-ig2qs97tvl="">This is a message</span>
</div>
<div class="fluent-messagebar-container-action" b-ig2qs97tvl="">
<svg class="fluent-messagebar-close" style="width: 16px; fill: var(--neutral-foreground-rest); cursor: pointer;" focusable="false" viewBox="0 0 16 16" aria-hidden="true" blazor:onkeydown="5" blazor:onclick="6">
<path d="m2.59 2.72.06-.07a.5.5 0 0 1 .63-.06l.07.06L8 7.29l4.65-4.64a.5.5 0 0 1 .7.7L8.71 8l4.64 4.65c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L8 8.71l-4.65 4.64a.5.5 0 0 1-.7-.7L7.29 8 2.65 3.35a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"></path>
</svg>
</div>
</div>
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@

<div id="uniqueId" class="fluent-messagebar intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-ig2qs97tvl="">
<div class="fluent-messagebar-icon" b-ig2qs97tvl="">
<svg style="width: 20px; fill: var(--info);" focusable="false" viewBox="0 0 20 20" aria-hidden="true" blazor:onkeydown="3" blazor:onclick="4">
<title>info</title>
<path d="M18 10a8 8 0 1 0-16 0 8 8 0 0 0 16 0ZM9.5 8.91a.5.5 0 0 1 1 0V13.6a.5.5 0 0 1-1 0V8.9Zm-.25-2.16a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Z"></path>
</svg>
</div>
<div class="fluent-messagebar-message" b-ig2qs97tvl="">
<span class="title" b-ig2qs97tvl="">This is a message</span>
</div>
<div class="fluent-messagebar-container-action" b-ig2qs97tvl="">
<svg class="fluent-messagebar-close" style="width: 16px; fill: var(--neutral-foreground-rest); cursor: pointer;" focusable="false" viewBox="0 0 16 16" aria-hidden="true" blazor:onkeydown="5" blazor:onclick="6">
<path d="m2.59 2.72.06-.07a.5.5 0 0 1 .63-.06l.07.06L8 7.29l4.65-4.64a.5.5 0 0 1 .7.7L8.71 8l4.64 4.65c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L8 8.71l-4.65 4.64a.5.5 0 0 1-.7-.7L7.29 8 2.65 3.35a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"></path>
</svg>
</div>
<div id="uniqueId" class="fluent-messagebar fluent-messagebar-animation intent-info" blazor:onfocusin="1" blazor:onfocusout="2" b-ig2qs97tvl="">
<div class="fluent-messagebar-icon" b-ig2qs97tvl="">
<svg style="width: 20px; fill: var(--info);" focusable="false" viewBox="0 0 20 20" aria-hidden="true" blazor:onkeydown="3" blazor:onclick="4">
<title>info</title>
<path d="M18 10a8 8 0 1 0-16 0 8 8 0 0 0 16 0ZM9.5 8.91a.5.5 0 0 1 1 0V13.6a.5.5 0 0 1-1 0V8.9Zm-.25-2.16a.75.75 0 1 1 1.5 0 .75.75 0 0 1-1.5 0Z"></path>
</svg>
</div>
<div class="fluent-messagebar-message" b-ig2qs97tvl="">
<span class="title" b-ig2qs97tvl="">This is a message</span>
</div>
<div class="fluent-messagebar-container-action" b-ig2qs97tvl="">
<svg class="fluent-messagebar-close" style="width: 16px; fill: var(--neutral-foreground-rest); cursor: pointer;" focusable="false" viewBox="0 0 16 16" aria-hidden="true" blazor:onkeydown="5" blazor:onclick="6">
<path d="m2.59 2.72.06-.07a.5.5 0 0 1 .63-.06l.07.06L8 7.29l4.65-4.64a.5.5 0 0 1 .7.7L8.71 8l4.64 4.65c.18.17.2.44.06.63l-.06.07a.5.5 0 0 1-.63.06l-.07-.06L8 8.71l-4.65 4.64a.5.5 0 0 1-.7-.7L7.29 8 2.65 3.35a.5.5 0 0 1-.06-.63l.06-.07-.06.07Z"></path>
</svg>
</div>
</div>
20 changes: 20 additions & 0 deletions tests/Core/MessageBar/FluentMessageBarTests.cs
Original file line number Diff line number Diff line change
@@ -1,3 +1,7 @@
// ------------------------------------------------------------------------
// MIT License - Copyright (c) Microsoft Corporation. All rights reserved.
// ------------------------------------------------------------------------

using Bunit;
using Xunit;

Expand Down Expand Up @@ -59,6 +63,22 @@ public void FluentMessageBar_AllowDismiss()
cut.Verify();
}

[Fact]
public void FluentMessageBar_DisableFadeIn()
{
TestContext.Services.AddFluentUIComponents();

// Arrange
var cut = TestContext.RenderComponent<FluentMessageBar>(parameters =>
{
parameters.Add(p => p.Title, "This is a message");
parameters.Add(p => p.FadeIn, false);
});

// Assert
cut.Verify();
}

//[Fact]
//public void FluentMessageBar_Body_Link()
//{
Expand Down