Skip to content

Commit

Permalink
Merge branch '7761-dotnet9-rc2' of https://github.com/ysmoradi/bitpla…
Browse files Browse the repository at this point in the history
…tform into 7761-dotnet9-rc2
  • Loading branch information
ysmoradi committed Oct 30, 2024
2 parents d1174b6 + ae382de commit 15accdc
Showing 1 changed file with 84 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -366,7 +366,7 @@ public void BitSeparatorShouldRespectAutoSize(bool autoSize)
}

[DataTestMethod]
public void BitSeparatorShouldRespectFullWidthChangingAfterRender()
public void BitSeparatorShouldRespectAutoSizeChangingAfterRender()
{
var component = RenderComponent<BitSeparator>();

Expand All @@ -380,6 +380,88 @@ public void BitSeparatorShouldRespectFullWidthChangingAfterRender()
component.MarkupMatches(@"<div style=""width:auto"" class=""bit-spr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");
}

[DataTestMethod,
DataRow(null),
DataRow(BitColorKind.Primary),
DataRow(BitColorKind.Secondary),
DataRow(BitColorKind.Tertiary),
DataRow(BitColorKind.Transparent)
]
public void BitSeparatorShouldRespectBackground(BitColorKind? background)
{
var component = RenderComponent<BitSeparator>(parameters =>
{
parameters.Add(p => p.Background, background);
});

var cssClass = background switch
{
BitColorKind.Primary => "bit-spr-pbg",
BitColorKind.Secondary => "bit-spr-sbg",
BitColorKind.Tertiary => "bit-spr-tbg",
BitColorKind.Transparent => "bit-spr-rbg",
_ => null
};

component.MarkupMatches(@$"<div class=""{cssClass} bit-spr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");
}

[DataTestMethod]
public void BitSeparatorShouldRespectBackgroundChangingAfterRender()
{
var component = RenderComponent<BitSeparator>();

component.MarkupMatches(@"<div class=""bit-spr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");

component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Background, BitColorKind.Secondary);
});

component.MarkupMatches(@"<div class=""bit-spr bit-spr-sbg bit-spr-hrz bit-spr-ctr"" id:ignore></div>");
}

[DataTestMethod,
DataRow(null),
DataRow(BitColorKind.Primary),
DataRow(BitColorKind.Secondary),
DataRow(BitColorKind.Tertiary),
DataRow(BitColorKind.Transparent)
]
public void BitSeparatorShouldRespectBorder(BitColorKind? border)
{
var component = RenderComponent<BitSeparator>(parameters =>
{
parameters.Add(p => p.Border, border);
});

var cssClass = border switch
{
BitColorKind.Primary => "bit-spr-pbr",
BitColorKind.Secondary => "bit-spr-sbr",
BitColorKind.Tertiary => "bit-spr-tbr",
BitColorKind.Transparent => "bit-spr-rbr",
_ => null
};

component.MarkupMatches(@$"<div class=""{cssClass} bit-spr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");
}

[DataTestMethod]
public void BitSeparatorShouldRespectBorderChangingAfterRender()
{
var component = RenderComponent<BitSeparator>();

component.MarkupMatches(@"<div class=""bit-spr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");

component.SetParametersAndRender(parameters =>
{
parameters.Add(p => p.Border, BitColorKind.Secondary);
});

component.MarkupMatches(@"<div class=""bit-spr bit-spr-sbr bit-spr-hrz bit-spr-ctr"" id:ignore></div>");
}

[DataTestMethod,
DataRow(true),
DataRow(false)
Expand All @@ -403,7 +485,7 @@ public void BitSeparatorShouldRespectAutoSizeInVertical(bool autoSize)
}

[DataTestMethod]
public void BitSeparatorShouldRespectFullWidthChangingAfterRenderInVertical()
public void BitSeparatorShouldRespectAutoSizeChangingAfterRenderInVertical()
{
var component = RenderComponent<BitSeparator>(parameters =>
{
Expand Down

0 comments on commit 15accdc

Please sign in to comment.