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

Tests: Make ConfirmRemoveStudentDialogTest Enzyme-3 ready #29119

Merged
merged 1 commit into from Jun 14, 2019

Conversation

islemaster
Copy link
Contributor

@islemaster islemaster commented Jun 14, 2019

Following these instructions and reviewing this list I'm fixing up a few more tests to be ready for the Enzyme 3 upgrade.

I believe these are fixed in a backwards-compatible way; letting Drone confirm that.

Note: Diff best viewed ignoring whitespace.

Copy link
Contributor

@maddiedierker maddiedierker left a comment

Choose a reason for hiding this comment

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

:shipit: code changes look good! out of curiosity, is there a reason you updated expect statements to use assert instead?

@islemaster
Copy link
Contributor Author

islemaster commented Jun 14, 2019

I switched because you can assert(true) but you have to expect(true).to.be.true. The former seems like the more expressive way to use enzyme helpers now that we're moving away from chai-enzyme. For example:

// Before, with chai-enzyme
expect(wrapper).to.containMatchingElement(...);

// BDD-style without chai-enzyme
expect(wrapper.containsMatchingElement(...)).to.be.true;

// I prefer assert-style here:
assert(wrapper.containsMatchingElement(...));

(Testing: If you assert(false); your test will fail, but if you expect(false); it will pass!)

@islemaster islemaster merged commit a5e88e0 into staging Jun 14, 2019
@islemaster islemaster deleted the enzyme3-ConfirmRemoveStudentDialogTest branch June 14, 2019 17:15
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.

None yet

2 participants