Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Layout] Add Id to the container div #2123

Merged
merged 4 commits into from
May 30, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
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
4 changes: 2 additions & 2 deletions Directory.Packages.props
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@
<PackageVersion Include="System.Text.Json" Version="8.0.3" />
<!-- Test dependencies -->
<PackageVersion Include="bunit" Version="1.28.9" />
<PackageVersion Include="FluentAssertions" Version="7.0.0-alpha.3" />
<PackageVersion Include="FluentAssertions" Version="7.0.0-tags-7.0.0-tags-7-0-0-alpha-3.1" />
vnbaaij marked this conversation as resolved.
Show resolved Hide resolved
<PackageVersion Include="Microsoft.NET.Test.Sdk" Version="17.9.0" />
<PackageVersion Include="xunit" Version="2.8.0" />
<PackageVersion Include="xunit.runner.visualstudio" Version="2.8.0" />
<PackageVersion Include="coverlet.msbuild" Version="6.0.0" />
<PackageVersion Include="coverlet.collector" Version="6.0.2" />
</ItemGroup>
</Project>
</Project>
2 changes: 1 addition & 1 deletion src/Core/Components/Layout/FluentLayout.razor
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

@inherits FluentComponentBase

<div @ref=Element class="@ClassValue" style="@StyleValue" orientation="@_orientation" @attributes="AdditionalAttributes">
<div @ref=Element id="@Id" class="@ClassValue" style="@StyleValue" orientation="@_orientation" @attributes="AdditionalAttributes">
@ChildContent
</div>

Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@

<div id="xxx" class="layout" b-emdrz8ckod="" blazor:elementreference="xxx"></div>
13 changes: 13 additions & 0 deletions tests/Core/Layout/FluentLayoutTests.razor
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,19 @@
cut.Verify();
}

[Fact]
public void FluentLayout_Id()
{
//Arrange
var cut = Render(@<FluentLayout Id="42" />);

//Act

//Assert
cut.Verify();
}


[Fact]
public void FluentLayout_AdditionalProperties()
{
Expand Down
Loading