Skip to content
This repository has been archived by the owner on Nov 21, 2022. It is now read-only.

Integration tests #105

Closed
3 tasks done
djbusstop opened this issue Mar 10, 2020 · 3 comments
Closed
3 tasks done

Integration tests #105

djbusstop opened this issue Mar 10, 2020 · 3 comments

Comments

@djbusstop
Copy link
Contributor

djbusstop commented Mar 10, 2020

Is your feature request related to a problem? Please describe.
No

Describe the solution you'd like
We should ideally test that the code in content that modifies the browser window works as expected. One way to test this would be to trigger an event that would cause the tweets to be styled, and check that the styling was applied. In our case that means checking classes were applied.

It may be useful to keep a copy of a twitter page downloaded to use as the example twitter page we attempt to modify.

I was thinking to use jsdom to mock a browser page, I tried this but was running in to problems because I could not figure out how to run our code on another dom. But it should be possible.

Describe alternatives you've considered
End to End testing. Really not a bad idea. I think that if this is too hard, we should really consider this. And cypress does firefox now. End to end testing requires more overhead and configuration, so in this case I would like to avoid it.

If testing the interaction between the dom and the content scripts for the plugin are too difficult to do with jest, we should seriously consider End to End testing

Minimum requirements

  • Twitter dom has changed (css class for modified tweet style)

  • Testing that tweet text is correctly extracted

  • Test that fetch request sends with correct params

  • (Moved to Test API request is fired when expected #119) Test that api request is fired at proper time

@djbusstop djbusstop changed the title Tests on event listeners Integration tests Mar 25, 2020
@djbusstop
Copy link
Contributor Author

Things to test, from @malteserteresa:
TODO: Create issue for testing api on backend @malteserteresa (if you get a chance)

  • Twitter dom has changed (css class for modified tweet style)
  • Testing that tweet text is correctly extracted
    • Integration test would test that some event handler works
    • Otherwise this is a unit test
  • Test that api request is fired at proper time

@malteserteresa
Copy link
Member

Testing API issue

@djbusstop
Copy link
Contributor Author

I have reduced the scope of this task by removing the open test to it's own issue, so we can close this for the sprint but still have a log.

Here's the new issue for the last remaining test, testing when the API was fired: #119

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests

2 participants