-
Notifications
You must be signed in to change notification settings - Fork 2
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
Unit tests #27
Unit tests #27
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM, I tried to check that tests should be doing what they are supposed to, Im not really fan of mocks but we have to work with what we have :)
Good work!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM 👍 I'm wondering if we could have a CI step that checks whether the mocks need to be regenerated. Something along the lines of running the generator and checking that nothing changed.
I've added a ticket for this #37. I'll catch that with other bug fixes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How come this file is not in a mocks/
folder and has a slightly different naming? i.e. something_mock.go
instead of mock_something.go
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I can change the name of it to match the others. It wasn't auto-generated so it didn't seem right to include it next to all the other auto-generated mocks. It could get lost in there?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Oh that makes sense
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have tested this PR and the expiration date and token is updated upon re-uploading the plugin also the basic functionality of the plugin is working fine. LGTM.
Summary
I had to use mocks for the unit tests due to the use of the Google api package. I apologize but the tests are hard to read due to the amount of mocking 😅
Test cases
drive_change_channels-<userid>
. The PValue will looks something like this:{ "channel_id": "3376dacc-fc44-456c-83da-e89fb46ebff6", "resource_id": "<resource>", "mm_user_id": "jrhwa8mch38hjymsr7kuy7smnh", "expiration": 1731962203000, "token": "<token>", "page_token": "1053" }