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

chore(Slider) update integration tests #10520

Merged
merged 3 commits into from
Sep 10, 2024

Conversation

Dominik-Petrik
Copy link
Contributor

What: Closes #5362

@patternfly-build
Copy link
Contributor

patternfly-build commented Jun 4, 2024

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Couple comments below merge conflict.

Could we add tests for moving the slider via keyboard as well? E.g. when the thumb has focus, Left Arrow should decrease the value by however much and Right Arrow should increase it.

Comment on lines 21 to 23
cy.get('#discrete-slider')
.invoke('attr', 'style')
.should('be.oneOf', [
Copy link
Contributor

Choose a reason for hiding this comment

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

Not a blocker, but wondering if we'd ever run into a situation where the amount of whitespace is more than the array of strings here. If we ever did we may want to consider using the match assertion in Cypress with a regex instead of having to potentially keep adding to this array

@@ -3,43 3,114 @@ describe('Slider Demo Test', () => {
cy.visit('http://localhost:3000/slider-demo-nav-link');
});

it.skip('renders the discrete slider', () => {
it('renders the discrete slider', () => {
Copy link
Contributor

Choose a reason for hiding this comment

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

Sort of feel like these "Renders the X slider" tests should be unit tests instead and omitted here.

If the point of these tests is to have a baseline value for the styles, I think we could just move the lines that do that to the "changes value when dragged" tests instead. E.g. first check that the slider style values are X, trigger the drag events, then check that the slider styles values are Y.

Copy link
Contributor

@thatblindgeye thatblindgeye left a comment

Choose a reason for hiding this comment

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

Just needs a rebase but otherwise 🔥

@tlabaj tlabaj merged commit 5b9adcf into patternfly:v5 Sep 10, 2024
13 checks passed
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.

Slider: Add integration test
5 participants