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

[Task] Create Tests for List Component #222

Closed
billhimmelsbach opened this issue Oct 27, 2023 · 2 comments · Fixed by #234
Closed

[Task] Create Tests for List Component #222

billhimmelsbach opened this issue Oct 27, 2023 · 2 comments · Fixed by #234

Comments

@billhimmelsbach
Copy link
Contributor

billhimmelsbach commented Oct 27, 2023

The List component doesn't have tests written for it yet, and it would be great to establish some basic tests to check that it renders correctly. I'm imagining 5 test cases to start based on the code below:

const cnames = [className, 'm-list'];
if (isHorizontal) cnames.push('m-list__horizontal');
if (isLinks) cnames.push('m-list__links');
if (isSpaced) cnames.push('m-list__spaced');
if (isUnstyled) cnames.push('m-list__unstyled');
if (isOrdered) return <ol className={classnames(cnames)}>{children}</ol>;

This issue would be completed if the following tests are written:

  1. m-list__horizontal class is added to List when isHorizontal prop is passed in

  2. m-list__links class is added to List when isLinks prop is passed in

  3. m-list__spaced class is added to List when isSpaced prop is passed in

  4. m-list__unstyled class is added to List when isUnstyled prop is passed in

  5. <ol> list is rendered when isOrdered prop is passed in

Add these 5 render tests into a file called List.test.tsx in the same folder as List.tsx.

The tests could look very similar to other basic rendering tests in the codebase like these label tests.

Let me know if you have any questions! 👍

@billhimmelsbach billhimmelsbach changed the title [Task] Create Tests for List [Task] Create Tests for List Component Oct 28, 2023
@alberturria
Copy link
Contributor

Hey @billhimmelsbach , may I take this issue? 🙏

@billhimmelsbach
Copy link
Contributor Author

Hi @alberturria! 👋

You definitely can, and thank you! I'll review your PR tonight.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants