Skip to content

Conversation

@kyledurand
Copy link
Member

WHAT is this pull request doing?

Modernizes the tests for option list and its subcomponents

How to 🎩

🖥 Local development instructions
🗒 General tophatting guidelines
📄 Changelog guidelines

Copy-paste this code in playground/Playground.tsx:
import React from 'react';
import {Page} from '../src';

export function Playground() {
  return (
    <Page title="Playground">
      {/* Add the code you want to test in here */}
    </Page>
  );
}

🎩 checklist

@kyledurand kyledurand added the 🤖Skip Changelog Causes CI to ignore changelog update check. label Aug 25, 2021
@kyledurand kyledurand self-assigned this Aug 25, 2021
@github-actions
Copy link
Contributor

size-limit report

Path Size
cjs 143.11 KB (0%)
esm 96.81 KB (0%)
esnext 140.11 KB (0%)
css 33.96 KB (0%)

@kyledurand kyledurand requested a review from rdott August 26, 2021 14:27
const input = mountWithApp(<Checkbox {...defaultProps} />).find('input')!;
const {checked, disabled, id, name, value} = defaultProps;

expect(input.prop('checked')).toBe(checked);
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggestion for readability:

expect(input).toHaveReactProps({
  disabled,
  id,
  name,
  value
});

or potentially drop the .find('input');

expect(wrapper).toContainReactComponent('input', {
  disabled,
  id,
  name,
  value
});

Copy link
Contributor

@rdott rdott left a comment

Choose a reason for hiding this comment

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

Just one small comment/suggested change, but not blocking. LGTM!

@kyledurand kyledurand force-pushed the option-list_modernize-tests branch from f6f145d to 7cb1f22 Compare August 26, 2021 17:33
@kyledurand kyledurand merged commit 5deaf47 into main Aug 26, 2021
@kyledurand kyledurand deleted the option-list_modernize-tests branch August 26, 2021 17:45
@kyledurand kyledurand removed the 🤖Skip Changelog Causes CI to ignore changelog update check. label Aug 26, 2021
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.

3 participants