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(slider): add token theme tests #9665

Conversation

eriklharper
Copy link
Contributor

Related Issue: #7180

Summary

This PR adds token theme tests for calcite-slider.

@eriklharper eriklharper marked this pull request as ready for review June 25, 2024 18:50
@eriklharper eriklharper requested a review from a team as a code owner June 25, 2024 18:50
@eriklharper
Copy link
Contributor Author

Additional notes:

I was unsuccessful getting this extra test to pass, and I'm unsure why:

describe.only("handle focus", () => {
  const tokens: ComponentTestTokens = {
    "--calcite-slider-handle-border-color-hover": {
      shadowSelector: `.${CSS.handle}`,
      targetProp: "boxShadow",
      state: "focus",
    },
  };
  themed(html` <calcite-slider min="0" max="100" value="20" step="10"></calcite-slider> `, tokens);
});

This is an attempt to test that the handle-border-color-hover token is properly applied to the handle as a boxShadow color when the .thumb (parent div of handle) is focused. I tried state: "focus" and state: { focus: { attribute: "class", value: CSS.handle } }.

Copy link
Contributor

@alisonailea alisonailea left a comment

Choose a reason for hiding this comment

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

because we are using the same color to test multiple values its possible to get a false positive on tests. Make sure you are stopping the test just before verification and confirming the tokens are correctly applied. Or check in storybook.

@eriklharper
Copy link
Contributor Author

because we are using the same color to test multiple values its possible to get a false positive on tests. Make sure you are stopping the test just before verification and confirming the tokens are correctly applied. Or check in storybook.

Should we randomize the color being used in each test run?

@eriklharper eriklharper requested a review from alisonailea July 2, 2024 18:55
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jul 10, 2024
@github-actions github-actions bot removed the Stale Issues or pull requests that have not had recent activity. label Jul 15, 2024
Copy link
Contributor

This PR has been automatically marked as stale because it has not had recent activity. Please close your PR if it is no longer relevant. Thank you for your contributions.

@github-actions github-actions bot added the Stale Issues or pull requests that have not had recent activity. label Jul 25, 2024
@jcfranco
Copy link
Member

Closing as we are tackling component tokens in smaller chunks. Thanks, everyone! ✨💪✨

@jcfranco jcfranco closed this Sep 15, 2024
@jcfranco jcfranco deleted the eriklharper/7180-slider-token-tests branch September 15, 2024 06:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Stale Issues or pull requests that have not had recent activity.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants