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

test(module: slider) Add tests, Small refactors #2818

Merged
merged 1 commit into from
Oct 20, 2022

Conversation

kooliokey
Copy link
Contributor

  • Add tests for slider
  • Remove commented out code.
  • Refactor checking a double against zero to check against a tight range around zero because it will fail sometimes.
  • Update aria attributes on handles to have proper values.

🤔 This is a ...

  • New feature
  • Bug fix
  • Site / documentation update
  • Demo update
  • Component style update
  • Bundle size optimization
  • Performance optimization
  • Refactoring
  • Code style optimization
  • Test Case
  • Branch merge
  • Other (about what?)

🔗 Related issue link

#2644

💡 Background and solution

📝 Changelog

Language Changelog
🇺🇸 English Slider accessibility updates with aria labels
🇨🇳 Chinese

☑️ Self Check before Merge

⚠️ Please check all items below before review. ⚠️

  • Doc is updated/provided or not needed
  • Demo is updated/provided or not needed
  • Changelog is provided or not needed

…double against zero to check against a tight range around zero because it will fail sometimes. Update aria attributes on handles to have proper values.
@github-actions
Copy link

github-actions bot commented Oct 19, 2022

@@ -477,6 +463,7 @@ protected override void OnParametersSet()
ClassMapper.Clear()
.Add(PreFixCls)
.If($"{PreFixCls}-disabled", () => Disabled)
.If($"{PreFixCls}-horizontal", () => !Vertical)
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added this class because it is in the react version whenever it is horizontal. Didn't appear to affect any visuals for now though. Perhaps a style update will make use of it in the future and prevent a bug.

Copy link
Member

Choose a reason for hiding this comment

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

Our current style is only synchronized to 4.20.7 (and many changes to the component html are not synchronized), and the latest one needs to check whether the component style is updated before merging. Could you please take a look at it?

#2814

@@ -527,23 +514,15 @@ private void ValidateParameter()
throw new ArgumentOutOfRangeException(nameof(Step), "Must greater than 0.");
}

if (Step != null && (Max - Min) / Step % 1 != 0)
var minMaxStepComparison = (Max - Min) / Step % 1;
Copy link
Contributor Author

Choose a reason for hiding this comment

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

Is this logic necessary? I don't see it in the react library and the slider library that Ant react uses doesn't bother checking for this either. Did not doing it cause a bug before?

Copy link
Member

Choose a reason for hiding this comment

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

Maybe not.

@codecov
Copy link

codecov bot commented Oct 19, 2022

Codecov Report

Base: 40.20% // Head: 42.54% // Increases project coverage by +2.33% 🎉

Coverage data is based on head (14e60c4) compared to base (0de1573).
Patch coverage: 100.00% of modified lines in pull request are covered.

Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2818      +/-   ##
==========================================
+ Coverage   40.20%   42.54%   +2.33%     
==========================================
  Files         544      544              
  Lines       25739    25736       -3     
  Branches      260      260              
==========================================
+ Hits        10349    10950     +601     
+ Misses      15350    14746     -604     
  Partials       40       40              
Impacted Files Coverage Δ
components/slider/Slider.razor 100.00% <100.00%> (+100.00%) ⬆️
components/slider/Slider.razor.cs 62.02% <100.00%> (+62.02%) ⬆️
components/select/Select.razor.cs 53.18% <0.00%> (+0.26%) ⬆️
components/select/SelectBase.cs 71.19% <0.00%> (+0.27%) ⬆️
components/input/Input.cs 67.25% <0.00%> (+0.35%) ⬆️
components/date-picker/DatePicker.Razor.cs 77.48% <0.00%> (+0.66%) ⬆️
components/core/JsInterop/JSInteropConstants.cs 29.60% <0.00%> (+0.80%) ⬆️
components/core/CssSizeLength.cs 86.07% <0.00%> (+1.07%) ⬆️
components/grid/Col.razor.cs 96.00% <0.00%> (+1.33%) ⬆️
components/date-picker/internal/DatePickerBase.cs 70.57% <0.00%> (+1.60%) ⬆️
... and 22 more

Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.

☔ View full report at Codecov.
📢 Do you have feedback about the report comment? Let us know in this issue.

Copy link
Member

@ElderJames ElderJames left a comment

Choose a reason for hiding this comment

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

LGTM

@ElderJames ElderJames merged commit 75d108e into ant-design-blazor:master Oct 20, 2022
@ElderJames ElderJames mentioned this pull request Oct 28, 2022
62 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants