Skip to content

Add tests for molecules checkbox form field#69

Merged
brandongregoryscott merged 6 commits into
rsm-hcd:mainfrom
SaidShah:add-tests-for-molecules-checkbox-form-field
Nov 3, 2020
Merged

Add tests for molecules checkbox form field#69
brandongregoryscott merged 6 commits into
rsm-hcd:mainfrom
SaidShah:add-tests-for-molecules-checkbox-form-field

Conversation

@SaidShah
Copy link
Copy Markdown
Contributor

  • Related GitHub issue(s) linked in PR description
  • Destination branch merged, built and tested with your changes
  • Code formatted and follows best practices and patterns
  • Code builds cleanly (no additional warnings or errors)
  • Manually tested
  • Automated tests are passing
  • No decreases in automated test coverage
  • Documentation updated (readme, docs, comments, etc.)
  • Localization: No hard-coded error messages in code files (minimally in string constants)
  • New component and/ or properties? Make sure to update storybook

Closes #23

@codecov
Copy link
Copy Markdown

codecov Bot commented Oct 29, 2020

Codecov Report

Merging #69 into main will increase coverage by 0.11%.
The diff coverage is n/a.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #69      +/-   ##
==========================================
+ Coverage   25.66%   25.77%   +0.11%     
==========================================
  Files          51       51              
  Lines         900      900              
  Branches      209      209              
==========================================
+ Hits          231      232       +1     
  Misses        662      662              
+ Partials        7        6       -1     
Impacted Files Coverage Δ
src/molecules/form-fields/checkbox-form-field.tsx 100.00% <0.00%> (+16.66%) ⬆️

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 757bd1a...c0158f6. Read the comment docs.

Copy link
Copy Markdown
Contributor

@brandongregoryscott brandongregoryscott left a comment

Choose a reason for hiding this comment

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

Just some minor feedback @SaidShah 👍

checked={false}
label={expected}
onChange={() => {}}
errorMessage={testErrorMessage}
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Nitpick - alphabetization


test("when errorsMessage prop set, renders with error message", () => {
// Arrange
const expected = faker.random.words();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same comment from your other PR - since we're not actually asserting on this value (or even using it, really), I would probably just name this label.

test("when onChange set, calls handler upon change", () => {
// Arrange
let isChecked = false;
const expected = faker.random.word();
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Same as above ☝️ while it's being used here, expected leads me to believe we're looking for this value to be set somewhere in the assert step.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

Thanks for the feedback. I have updated the PR if you would like to take another look.

@brandongregoryscott brandongregoryscott merged commit 78d6ec7 into rsm-hcd:main Nov 3, 2020
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.

Backfill tests for Molecules/CheckboxFormField

3 participants