Skip to content

Fluent UI tests for Checkbox#13

Open
vidya-mb wants to merge 3 commits intodipeshmsft:fluent/ui-tests-controlfrom
vidya-mb:CheckboxUI
Open

Fluent UI tests for Checkbox#13
vidya-mb wants to merge 3 commits intodipeshmsft:fluent/ui-tests-controlfrom
vidya-mb:CheckboxUI

Conversation

@vidya-mb
Copy link

@vidya-mb vidya-mb commented Jan 9, 2025

Basic fluent UI tests for Checkbox.

public void Checkbox_Indeterminate_Test(ColorMode colorMode)
{
SetColorMode(TestWindow, colorMode);
TestCheckbox.IsChecked = null;
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

For InDeterminate we will need to set IsThreeState=true should be set too if I am not wrong.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Set IsThreeState=true for indeterminate state.

part_checkbox.Cursor.Should().Be(expectedProperties["CheckBox_Cursor"]);
part_checkbox.IsTabStop.Should().Be((bool)expectedProperties["Checkbox_IsTabStop"]);
//rootborder
part_RootBorder.Should().NotBeNull();
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We will need to check Background, BorderBrush and BorderThickness for part_RootBorder as well as in the style RootBorder has template bindings to Background, BorderBrush, etc.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added validation for properties of part_RootBorder.


part_ContentPresenter.RecognizesAccessKey.Should().Be((bool)expectedProperties["ContentPresenter_RecognizesAccessKey"]);
part_ContentPresenter.HorizontalAlignment.Should().Be((HorizontalAlignment)expectedProperties["ContentPresenter_HorizontalAlignment"]);
part_ContentPresenter.VerticalAlignment.Should().Be((VerticalAlignment)expectedProperties["ContentPresenter_VerticalAlignment"]);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

contentPresenter Foreground should also be checked as in WinUI style Foreground has a TemplateBinding to ContentPresenter's Foreground.

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ContentPresenter does not support foreground.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants