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

Add unit test for data-hook and instantiateAll #1159

Merged
merged 2 commits into from
Jan 21, 2021
Merged

Conversation

anselmbradford
Copy link
Member

Changes

  • Add unit test spec for data-hook.js.
  • Adjust data-hook import to import specific methods.
  • Add additional instantiateAll test.

Testing

  1. gulp test:unit should pass.

@anselmbradford anselmbradford added the lerna-changelog/bug lerna label. DO NOT MODIFY label Jan 19, 2021
@netlify
Copy link

netlify bot commented Jan 19, 2021

Thanks for the improvements! Browse a preview of your changes using the link below.

Built with commit e749374

https://deploy-preview-1159--cfpb-design-system.netlify.app

@anselmbradford anselmbradford changed the title Add more tests Add unit test for data-hook and instantiateAll Jan 19, 2021
} );
} );

describe( 'remove()', () => {
Copy link
Member

Choose a reason for hiding this comment

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

The remove() test is in here twice.

Copy link
Member Author

Choose a reason for hiding this comment

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

🤔 not sure how that happened, but fixed!

@@ -9,7 +9,7 @@
- Atom
========================================================================= */

import * as dataHook from './data-hook';
import { add, contains, remove } from './data-hook';
Copy link
Member

Choose a reason for hiding this comment

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

Why import the individual methods separately? For clarity?

Copy link
Member Author

Choose a reason for hiding this comment

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

Yeah so if you search for the methods you will get the import statement in the search results. Also, if data-hook has more added to it, it won't be automatically pulled into this file where it's unneeded.

@anselmbradford anselmbradford merged commit ca5fee0 into main Jan 21, 2021
@anselmbradford anselmbradford deleted the ans_add_tests branch January 21, 2021 16:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
lerna-changelog/bug lerna label. DO NOT MODIFY
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants