-
Notifications
You must be signed in to change notification settings - Fork 4
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
[Slider#204] Added snapshot tests + corrected CGColor not updating on traitCollectionDidChange + added comments on functions using CGLayers like applyShadow #677
Conversation
[Slider#204] Colors & shapes + use cases
[Slider#204] Started ViewModel + Added SliderGetClosestValueUseCase
…e (UISlider does indeed trigger a newValue even if the old one is equal to the new one)
[Slider#204] Implementation of SliderUIControl
613360e
to
6429a81
Compare
private func _test(scenario: SliderScenario) { | ||
let configurations = self.createConfigurations(from: scenario) | ||
for configuration in configurations { | ||
self.assertSnapshot(matching: configuration.view, modes: scenario.modes, sizes: [.medium], testName: configuration.testName) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have some constant to have the same accessibility sizes for all components (ComponentSnapshotTestConstants). I think you can also put this value inside your configuration
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
slider.widthAnchor.constraint(equalToConstant: 200) | ||
]) | ||
switch value { | ||
case .medium: slider.setValue(0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Because on the futur you will have the SwiftUI version, you can put the value (0.5, 0, 1) on your configuration ? Same for the testName.
You can check this configuration if you want: ProgressBarConfigurationSnapshotTests
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@@ -8,7 +8,7 @@ | |||
|
|||
import UIKit | |||
|
|||
enum ComponentSnapshotTestMode: String { | |||
enum ComponentSnapshotTestMode: String, CaseIterable { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Instead of CaseIterable, we manage the modes of the snapshot on a Constants:
- ComponentSnapshotTestConstants.Modes.all if you want to test all values
- ComponentSnapshotTestConstants.Modes.def if you want to test only the default value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
…e (UISlider does indeed trigger a newValue even if the old one is equal to the new one)
… traitCollectionDidChange + added comments on functions using CGLayers like applyShadow
3d843bf
to
82586e6
Compare
84cbbc2
to
21c1f51
Compare
About the checkbox spacing, it's just a stackview in which I didn't set spacing value, let me add that real quick :) About the floating values, it's the thing with floating numbers https://stackoverflow.com/questions/588004/is-floating-point-math-broken |
From branch 204-component-slider-develop to 204-component-slider