-
Notifications
You must be signed in to change notification settings - Fork 394
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Move Slider tests out of ToDo and add more tests
- Loading branch information
Showing
13 changed files
with
123 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,46 @@ | ||
@page "/IssueTester" | ||
@page "/IssueTester" | ||
|
||
<PageTitle>Counter</PageTitle> | ||
|
||
<h1>Counter</h1> | ||
|
||
<p role="status"> | ||
Current count: <FluentBadge Appearance="Appearance.Accent">@currentCount</FluentBadge> | ||
</p> | ||
|
||
<FluentButton Appearance="Appearance.Accent" @onclick="IncrementCount">Click me</FluentButton> | ||
|
||
<br /> | ||
<br /> | ||
|
||
<EditForm Model="@Content" OnValidSubmit="@SaveAsync"> | ||
<FluentStack Orientation="Orientation.Vertical"> | ||
<FluentCheckbox @bind-Value=@Content.IsChecked>Check test</FluentCheckbox> | ||
<FluentSwitch @bind-Value=Content.Switch CheckedMessage="On" UncheckedMessage="Off"> | ||
Switch test | ||
</FluentSwitch> | ||
<FluentButton Type="ButtonType.Submit" Appearance="Appearance.Accent">Submit</FluentButton> | ||
</FluentStack> | ||
</EditForm> | ||
|
||
@code { | ||
public class TestData | ||
{ | ||
public string? Title { get; set; } | ||
|
||
public bool IsChecked { get; set; } | ||
public bool Switch { get; set; } | ||
} | ||
|
||
public TestData Content = new(); | ||
|
||
private int currentCount = 0; | ||
|
||
private void IncrementCount() | ||
{ | ||
currentCount++; | ||
} | ||
private async Task SaveAsync() | ||
Check warning on line 43 in examples/Demo/Shared/Pages/Lab/IssueTester.razor GitHub Actions / Build and deploy Demo site
Check warning on line 43 in examples/Demo/Shared/Pages/Lab/IssueTester.razor GitHub Actions / Build and deploy Demo site
Check warning on line 43 in examples/Demo/Shared/Pages/Lab/IssueTester.razor GitHub Actions / Build and deploy Demo site
|
||
{ | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
File renamed without changes.
2 changes: 2 additions & 0 deletions
2
tests/Core/Slider/FluentSliderTests.FluentButton_Title.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
|
||
<fluent-button type="button" aria-label="My Title" title="My Title" blazor:onclick="1" appearance="neutral" blazor:elementreference="8a9c23b1-ac50-4d7f-8bac-3bde51902752">My button</fluent-button> |
2 changes: 1 addition & 1 deletion
2
...rTests.FluentSlider_Default.verified.html → ...rTests.FluentSlider_Default.verified.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
|
||
<label for="xxx" class="fluent-input-label" style="margin-bottom: calc(var(--design-unit) * 3px);" b-ijcaj0p60b=""> | ||
</label> | ||
<fluent-slider min="0" max="0" step="0" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"> | ||
<fluent-slider class="horizontal" min="0" max="0" step="0" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"> | ||
<b>render me</b> | ||
</fluent-slider> |
4 changes: 4 additions & 0 deletions
4
tests/Core/Slider/FluentSliderTests.FluentSlider_Double.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<label for="xxx" class="fluent-input-label" style="margin-bottom: calc(var(--design-unit) * 3px);" b-hum22yrq17=""> | ||
</label> | ||
<fluent-slider class="horizontal" min="-1.5" max="7" step="0.5" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"></fluent-slider> |
4 changes: 4 additions & 0 deletions
4
tests/Core/Slider/FluentSliderTests.FluentSlider_Horizontal.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<label for="xxx" class="fluent-input-label" style="margin-bottom: calc(var(--design-unit) * 3px);" b-hum22yrq17=""> | ||
</label> | ||
<fluent-slider class="horizontal" min="0" max="100" step="10" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"></fluent-slider> |
4 changes: 4 additions & 0 deletions
4
tests/Core/Slider/FluentSliderTests.FluentSlider_HorizontalImplicit.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<label for="xxx" class="fluent-input-label" style="margin-bottom: calc(var(--design-unit) * 3px);" b-hum22yrq17=""> | ||
</label> | ||
<fluent-slider class="horizontal" min="0" max="100" step="10" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"></fluent-slider> |
4 changes: 4 additions & 0 deletions
4
tests/Core/Slider/FluentSliderTests.FluentSlider_Vertical.verified.razor.html
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
|
||
<label for="xxx" class="fluent-input-label" style="margin-bottom: calc(var(--design-unit) * 3px);" b-hum22yrq17=""> | ||
</label> | ||
<fluent-slider class="vertical" min="0" max="100" step="10" orientation="vertical" id="xxx" value="0" blazor:onchange="1" blazor:elementreference="xxx"></fluent-slider> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
@using Xunit; | ||
@inherits TestContext | ||
@code | ||
{ | ||
[Fact] | ||
public void FluentSlider_HorizontalImplicit() | ||
{ | ||
// Arrange && Act | ||
var cut = Render(@<FluentSlider Min="0" Max="100" Step="10"></FluentSlider>); | ||
|
||
// Assert | ||
cut.Verify(); | ||
} | ||
|
||
[Fact] | ||
public void FluentSlider_Horizontal() | ||
{ | ||
// Arrange && Act | ||
var cut = Render(@<FluentSlider Min="0" Max="100" Step="10"></FluentSlider>); | ||
|
||
// Assert | ||
cut.Verify(); | ||
} | ||
|
||
[Fact] | ||
public void FluentSlider_Vertical() | ||
{ | ||
|
||
// Arrange | ||
var cut = Render(@<FluentSlider Min="0" Max="100" Step="10" Orientation="Orientation.Vertical"></FluentSlider>); | ||
|
||
// Assert | ||
cut.Verify(); | ||
} | ||
|
||
[Fact] | ||
public void FluentSlider_Double() | ||
{ | ||
double value = 3.5; | ||
// Arrange | ||
var cut = Render(@<FluentSlider Min="-1.50" Max="7.0" Step="0.5" @bind-bind-Value="@value"></FluentSlider>); | ||
|
||
// Assert | ||
cut.Verify(); | ||
} | ||
} |