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

Testing Umbrella Issue - Hacktoberfest #71

Closed
53 tasks done
PaulieScanlon opened this issue Sep 8, 2020 · 80 comments
Closed
53 tasks done

Testing Umbrella Issue - Hacktoberfest #71

PaulieScanlon opened this issue Sep 8, 2020 · 80 comments
Assignees
Labels
enhancement New feature or request hacktoberfest Open source is changing the world - one pull request at a time

Comments

@PaulieScanlon
Copy link
Owner

PaulieScanlon commented Sep 8, 2020

⛱️ Testing Umbrella Issue - Hacktoberfest

The time is right. We're now on to the last leg of the migration and something i never got round to in the old repo was adding a test suite.

🚀 Getting Started

If you're interested in helping out with tests and taking part in Hacktoberfest please comment below and let us know if it's the unit or integration test you'd like to tackle.

We'll then assign your username/name next to the component in the list below to try and avoid duplication.
Once a PR has been created we'll then be able to assign you to the actual issue which should then appear in your Hacktoberfest contributions

🤝 Contributing

Before you start:

🎁 As a thank you

We know it's not much but if you would like to contribute and your PR is successfully merged we'll send you out a super cool limited edition MDX Embed sticker. If you're comfortable sharing your address you can email me [email protected]

🧪 The two tests

There's two different types of tests we'd like contributors to focus on, they are at the moment fairly simple tests. There is every chance contributors with more expertise in testing will advise on what should or shouldn't be tested.

I'm open to suggestions but at the very least each component will have the below which will get us to a stable 1.0.0 release

  • Unit test (Testing Library / React)
  • Integration test (Cypress)

❗ Issues

There's an issue for each component and named appropriately: e.g: Please check the issues in GitHub to see which tests are currently open or in progress

  • codepen-unit-test
  • codepen-integration-test

Each issue will be assigned the "Hacktoberfest" and perhaps the "good first issue" label?

# ✅ Acceptance Criteria

Unit Test

Unit tests are co-located e.g: packages/mdx-embed/src/components/codepen.test.tsx
... and here's a brief explanation of how we're writing unit tests

  • It will have a data-testid that is the name of the component e.g: data-testid="codepen" - observe directory name for clues on what the data-testid should be
  • It will have a data-testid attribute on the top level DOM node or iframe
  • it will have at least one test for it renders the component
  • It will have the correct file extension for the test file: e.g .test.tsx

Integration Test

Integration tests are located at cypress/integration/codepen.spec.js
... and here's a brief explanation about how we're currently writing integration tests

  • it will have at least one test which asserts if embed providers specific DOM are not undefined
  • It will have the correct file extension for the test file: e.g .spec.js

Unit Test Assignment List 👩‍💻👨‍💻

Integration Test Assignment List 👩‍💻👨‍💻

😅 Phew ---- all tasks complete

@PaulieScanlon PaulieScanlon self-assigned this Sep 8, 2020
@PaulieScanlon PaulieScanlon added enhancement New feature or request hacktoberfest Open source is changing the world - one pull request at a time labels Sep 8, 2020
@PaulieScanlon
Copy link
Owner Author

PaulieScanlon commented Sep 8, 2020

@tricinel
Copy link
Contributor

@PaulieScanlon I though maybe it was something I missed. No worries, I'm looking into it as well. Two pairs of eyes are better than one I guess ;) Appreciate the help and quick reply. Do let me know if you find the missing link and I'll do the same.

@tricinel
Copy link
Contributor

@PaulieScanlon I think I got it working properly now. I might do the cinnamon spec tests and push to my fork for you to check it out. The tests look like this now:

Screenshot 2020-10-20 at 19 31 06

@tricinel
Copy link
Contributor

@PaulieScanlon check this out: https://github.com/tricinel/mdx-embed/commit/1347e35f8beea6fbbe271113f48f1882987dce67. Adding this will probably break all existing integration tests (although I think they all or most gave false positives) - but the changes to make them work properly will be minimal. I've added a sanity test to check for false positives as well in the cinnamon spec.

With adding a cypress command as well, we don't need to import getIframeBody any more...it's available in the cy namespace.

What do you think?

@matiasfha
Copy link
Contributor

I like the addition of a sanity check, maybe that can be added as a command too?
And at least to me the getIframeBody as command makes sense!.. Nice addition!.

@PaulieScanlon I can help you with checking the other integration to check that works with the change  @tricinel is proposing. (during the week)

@PaulieScanlon
Copy link
Owner Author

@tricinel This is a beaut! Excellent job! I also like the addition of the Cypress.command. Its kind of similar to one of the Jest utils we have so again super brills job! I guess the only tricky part now is how may CI tests will fail when we merge this in.

As you say though it should be fairly minimal work to correct. We're not planning a new release for a little while anyway so it's not the end of the world if the tests are failing for a little while.

Would you like to create a PR and we'll see what happens 😬

Following that i'll assess what needs fixing up in the other tests and if you're cool to lend a hand @matiasfha we can work out a bit of a plan of attack.

How's that sound?

@matiasfha
Copy link
Contributor

Sounds good to me!.

Ping me here or in Discord and we can plan something! Happy to help

@tricinel
Copy link
Contributor

Yeah, sounds good to me. By the way, I did a find and replace in the integration folder for getIframeBody to replace with cy.getIframeBody and got 41 occurrences. Ran all the tests and got 1 failure, on airtable. I guess we're in a pretty good state.

I'll push in a sec.

@tricinel
Copy link
Contributor

Pushed in #191

@taylorcjohnson
Copy link

@taylorcjohnson Just a friendly nudge. You claimed the Strava Unit Test, would you still like to take this on. No worries if not we can remove your name from the list and allow other contributors the opportunity to claim it.

@PaulieScanlon Yes, apologies for the slow start, but I'd still like to take a crack at it. I can follow-up on Friday if I think I won't be able to help (to allow you to open it back up to other contributors).

@tricinel
Copy link
Contributor

So then the integration tests for Cinnamon should be done now, so I'll move on to the ones for Flickr, TikTok and Whimsical. Cheers!

@PaulieScanlon
Copy link
Owner Author

@taylorcjohnson Hey mate, yeah that's totally fine. No real rush just wanted to check you'd still like to take it on. Ty for the response!

@yenly
Copy link
Contributor

yenly commented Oct 21, 2020

@PaulieScanlon Twitch player displays "player.twitch.tv refused to connect." when running storybook locally. It works on the deployed site --> https://www.mdx-embed.com/?path=/docs/components-twitch--usage
Not sure how to test when it renders error page in the iframe.

@PaulieScanlon
Copy link
Owner Author

Hey @yenly Thanks for looking into this. There's more information about this particular integration tests on issue #122

@taylorcjohnson
Copy link

@PaulieScanlon Unfortunately, I won't be able to help with the Strava tests at the moment if you wanted to open it up to other contributors. Apologies - hope this doesn't cause any problems for you!

@tricinel
Copy link
Contributor

I'll have a look at the Strava tests if no one else is up for it. 👍

@PaulieScanlon
Copy link
Owner Author

@taylorcjohnson thanks for letting me know, no worries at all! @tricinel if you're up for it then please go ahead. I'll add your name up top! Thanks!!!

@JeffersonBledsoe
Copy link
Contributor

@PaulieScanlon Unfortunately I haven't found time & probably won't find any time soon to work on the Twitter integration tests (the local storyboard doesn't display as it does in the live storyboard). Feel free to unassign me so others can work on it :) If it doesn't get picked up again, I'll still try put some time in when I can!

@PaulieScanlon
Copy link
Owner Author

@JeffersonBledsoe hey mate, no problems at all. That Twitter one might be a little tricky. Perhaps i'll take that one on. Thanks for letting me know!

@PaulieScanlon
Copy link
Owner Author

Hey @remiroyc @tricinel @matiasfha Just a friendly nudge to see if you're still able to take on the tests above. No worries if not it's totally cool if you don't have capacity to do the work. We're hoping to have all tests completed by end of October so if you don't feel you'll have time could you let me know and i'll remove your name so others could potentially contribute.

Thanks in advance!

@tricinel
Copy link
Contributor

Hey @PaulieScanlon, I'll take care of Strava today :)

@PaulieScanlon
Copy link
Owner Author

@tricinel lovely stuff! Thanks so much!!

@matiasfha
Copy link
Contributor

@PaulieScanlon I have as WIP the pinterest one. I will work on this before EOW.

@PaulieScanlon
Copy link
Owner Author

@matiasfha thanks mate. I could take Instagram and Spotify off your hands if you like. We're keen to get this wrapped up today / tomorrow if possible.

@matiasfha
Copy link
Contributor

@PaulieScanlon I just open the PR for pinterest.
I can take Spotify later today and whatever is available.

@PaulieScanlon
Copy link
Owner Author

@matiasfha Mega thanks mate! Both Spotify and Pinterest are approved and merged. Just Instagram to go now, but i'm happy to pick this up.
You've done more than your fair share!

@PaulieScanlon
Copy link
Owner Author

Hello everyone, and Happy Halloween 🎃

As of 10.25 this morning (UK time) we have successfully closed 76 issues, and have reached an overall code coverage of 94% which is absolute brills considering we started with 0%

Myself, @spences10 and @molebox would like to thank you for all your hard word, your commitment to the cause and for all being so wonderful to collaborate with. I for one have really enjoyed this years Hacktoberfest and we hope you have too.

As mentioned above as a small thank you we do have a limited amount of MDX Embed stickers so if you're happy to share you address please email me [email protected] and i'll get a couple out in the post (mail) for you.

Work will continue on the repo and if any of you will like to contribute again keep an eye on the issues.

Excellent, excellent work everyone, and thanks again - we bloody did it! 🕺

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request hacktoberfest Open source is changing the world - one pull request at a time
Projects
None yet
Development

No branches or pull requests