itaditya / trick-or-treat-game

Play it for free here
https://trick-or-treat.netlify.com/
16 stars 17 forks source link

Add unit test for Score saving flow #72

Closed devTeaa closed 1 year ago

devTeaa commented 5 years ago

Pull Request description

Fixes #58, sorry @itaditya the old PR got nuked accidentally by me

Checklist for proper Pull Request

netlify[bot] commented 5 years ago

You can play this version of the game here

Built with commit ddee989ffb216d8a04ecf97cb207222aa828e9d5

https://deploy-preview-72--trick-or-treat.netlify.com

itaditya commented 5 years ago

fix the merge conflicts and the comment I left

devTeaa commented 5 years ago

@itaditya I have fixed as per comment above

devTeaa commented 5 years ago

@itaditya seems like there is syntax errors on current master branch, can you check it out?

itaditya commented 5 years ago

yeah there is some issue, but for now I'm just checking if your added test cases passes. Currently you are using react-testing-library which is outdated, now you need to use @testing-library/react.

devTeaa commented 5 years ago

it('should save the score to local storage', () => { ... })

it('should have 10 sprite tiles at the begining of the game', () => { ... })

both of these test throw random error on Game.test.js, any idea why?

Also how to trigger componentDidMount() with @testing-library/react?