Skip to content

Commit

Permalink
Make FluentTextArea.Appearance nullable
Browse files Browse the repository at this point in the history
Updated FluentTextArea.Appearance to be nullable, removing the default value. Adjusted related test files to reflect this change by removing the `appearance="outline"` attribute. Cleaned up `Components.Tests.csproj` by removing unnecessary `<None>` items. Updated multiple test verification files to align with the new nullable property.
  • Loading branch information
AClerbois committed Feb 11, 2025
1 parent 8791f94 commit 21d21a7
Show file tree
Hide file tree
Showing 6 changed files with 10 additions and 23 deletions.
2 changes: 1 addition & 1 deletion src/Core/Components/TextArea/FluentTextArea.razor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public FluentTextArea()
/// Gets or sets the visual appearance.
/// </summary>
[Parameter]
public TextAreaAppearance Appearance { get; set; } = TextAreaAppearance.Outline;
public TextAreaAppearance? Appearance { get; set; }

/// <summary>
/// Gets or sets the short hint displayed in the textarea before the user enters a value.
Expand Down
15 changes: 1 addition & 14 deletions tests/Core/Components.Tests.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -71,18 +71,5 @@
<AutoGen>True</AutoGen>
<DependentUpon>FluentLocalizer.resx</DependentUpon>
</Compile>
</ItemGroup>

<ItemGroup>
<None Update="Components\TextArea\FluentTextAreaTests.FluentInputText_Default.verified.razor.html">
<DependentUpon>FluentTextAreaTests.razor</DependentUpon>
</None>
<None Update="Components\TextArea\FluentTextAreaTests.FluentInputText_LabelTemplate.verified.razor.html">
<DependentUpon>FluentTextAreaTests.razor</DependentUpon>
</None>
<None Update="Components\TextArea\FluentTextAreaTests.FluentInputText_StartEndTemplate.verified.razor.html">
<DependentUpon>FluentTextAreaTests.razor</DependentUpon>
</None>
</ItemGroup>

</ItemGroup>
</Project>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<fluent-field id="xxx" label-position="above">
<fluent-textarea appearance="outline" auto-resize id="xxx" slot="input"></fluent-textarea>
<fluent-textarea auto-resize id="xxx" slot="input"></fluent-textarea>
</fluent-field>
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
<fluent-field id="xxx" label-position="above">
<fluent-textarea appearance="outline" block id="xxx" slot="input"></fluent-textarea>
<fluent-textarea block id="xxx" slot="input"></fluent-textarea>
</fluent-field>
Original file line number Diff line number Diff line change
Expand Up @@ -3,5 +3,5 @@
<label id="xxx" slot="label" for="xxx">
<div style="font-weight: bold;">My label</div>
</label>
<fluent-textarea appearance="outline" id="xxx" slot="input" blazor:onfocusout="1" blazor:onchange="2" blazor:oninput="3" blazor:elementreference="xxx"></fluent-textarea>
<fluent-textarea id="xxx" slot="input" blazor:onfocusout="1" blazor:onchange="2" blazor:oninput="3" blazor:elementreference="xxx"></fluent-textarea>
</fluent-field>
10 changes: 5 additions & 5 deletions tests/Core/Components/TextArea/FluentTextAreaTests.razor
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@

// Assert
cut.Find("fluent-textarea")
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" appearance=\"outline\" resize=\"{expectedAttribute}\" />");
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" resize=\"{expectedAttribute}\" />");
}

[Theory]
Expand All @@ -73,7 +73,7 @@

// Assert
cut.Find("fluent-textarea")
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" appearance=\"outline\" size=\"{expectedAttribute}\" />");
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" size=\"{expectedAttribute}\" />");
}

[Fact]
Expand Down Expand Up @@ -140,7 +140,7 @@
// Assert
Assert.Equal("new value", value);
cut.Find("fluent-textarea")
.MarkupMatches("<fluent-textarea id=\"myId\" slot=\"input\" appearance=\"outline\" value=\"new value\" />");
.MarkupMatches("<fluent-textarea id=\"myId\" slot=\"input\" value=\"new value\" />");
}

[Theory]
Expand All @@ -160,13 +160,13 @@
// Assert: Immediate
Assert.Equal(expectedImmediateValue, value);
cut.Find("fluent-textarea")
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" appearance=\"outline\" value=\"{expectedImmediateValue}\" />");
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" value=\"{expectedImmediateValue}\" />");

// Assert: After a small delay
await Task.Delay(200);
Assert.Equal(expectedDelayedValue, value);
cut.Find("fluent-textarea")
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" appearance=\"outline\" value=\"{expectedDelayedValue}\" />");
.MarkupMatches($"<fluent-textarea id=\"myId\" slot=\"input\" value=\"{expectedDelayedValue}\" />");
}

[Theory]
Expand Down

0 comments on commit 21d21a7

Please sign in to comment.