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(material-experimental/mdc-slider): add test harnesses #22648
Conversation
Adds test harnesses for the MDC-based slider components.
|
||
/** Harness for interacting with a MDC mat-slider in tests. */ | ||
export class MatSliderHarness extends ComponentHarness { | ||
// TODO(wagnermaciel): Implement this in a separate PR | ||
static hostSelector = '.mat-mdc-slider'; |
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.
I was on the fence on whether to implement separate harnesses for range and non-range sliders since the non-range is the most common case and having one harness means that the consumer would have to go through getStartThumb
all the time. I decided against it in order to match what the component's API looks like, but I'm open to changing it. If consumers find it annoying, they could query for MatSliderThumbHarness
directly as well.
} | ||
|
||
/** Gets the end thumb of the slider. Will throw an error for a non-range slider. */ | ||
async getEndThumb(): Promise<MatSliderThumbHarness> { |
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 could follow MDC's implementation (link) and use getThumb
and getThumbStart
similar to their getValue
and getValueStart
. I'm not saying we should - I actually like the way things are here - but I figured I should leave this suggestion
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.
Let's do it like this for now and we can revisit if folks find it difficult to use. I'm not a fan of repeating the same methods in the thumb and the slider.
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Adds test harnesses for the MDC-based slider components.