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

feat(framework-issues-logic): Split IsControlElementTrueRequired into 3 rules #706

Merged

Conversation

DaveTryon
Copy link
Contributor

@DaveTryon DaveTryon commented May 23, 2022

Details

This breaks the IsControlElementTrueRequired rule into 3 rules:

  1. IsControlElementTrueRequiredButtonWPF is restricted to WPF Buttons. We don't have a GitHub issue for the rule, but the steps are documented at https://docs.microsoft.com/en-us/accessibility-tools-docs/items/wpf/control_iscontrolelement#suggested-fix
  2. IsControlElementTrueRequiredTextInEditXAML is restricted to XAML Text elements inside an edit control. The docs will eventually point to [Accessibility] AutoSuggestBox and NumberBox PlaceholderText fails Accessibility Insights Pass microsoft-ui-xaml#6480, which is the issue tracking this behavior in the XAML framework
  3. IsControlElementTrueRequired is updated to exclude controls covered by the 2 previous rules.

Unit tests have been added (there were none for IsControlElementTrueRequired 😦 ), and the docs have been updated.

Motivation

Framework issue feature

Context

I changed the 2nd rule name slightly from the spec to better match its behavior. As a result, the link and the docs are slightly different from the rule name. We may want to make a pass through everything at the end of the feature to align everything.

Looking at MonsterTest.cs, we have a lot of rules that aren't reflected in the results. If the intent is to use this as a rule pin, then we'll need to refactor that a little bit. That feels like a separate PR.

Pull request checklist

@DaveTryon DaveTryon requested a review from a team as a code owner May 23, 2022 22:39
Copy link
Contributor

@katydecorah katydecorah left a comment

Choose a reason for hiding this comment

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

Looks good! Left one question to help clarify the change to the MonsterTest.

@@ -102,7 +102,7 @@ public void MonsterButtonTest()
Assert.AreEqual(EvaluationCode.NotApplicable, results[RuleId.IsContentElementTrueOptional]);
Assert.AreEqual(EvaluationCode.Pass, results[RuleId.IsControlElementPropertyExists]);
Assert.AreEqual(EvaluationCode.NotApplicable, results[RuleId.IsControlElementTrueOptional]);
Assert.AreEqual(EvaluationCode.Pass, results[RuleId.IsControlElementTrueRequired]);
Assert.AreEqual(EvaluationCode.NotApplicable, results[RuleId.IsControlElementTrueRequired]);
Copy link
Contributor

Choose a reason for hiding this comment

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

@DaveTryon Would you mind sharing a little bit about this change?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Since this is a WPF button, the new rule applies instead of the old one. I'll add a line to capture the new rule

@DaveTryon DaveTryon merged commit e4020ec into microsoft:main May 24, 2022
@DaveTryon DaveTryon deleted the split-IsControlElementTrueRequired branch May 24, 2022 17:32
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