OneSignal is a free push notification service for mobile apps. This plugin makes it easy to integrate your native iOS app with OneSignal. https://onesignal.com
Other
496
stars
263
forks
source link
[Tests] Add more complex user switching tests #1430
Add more complex user switching tests involving multiple calls to login / logout / user updates in a short span.
Details
Motivation
Adding more testing, and prevent regressions in behavior.
We have seen bugs come up when changes have been made that changed expected behavior.
Scope
Unit tests
Testing
Unit testing
Added new test class SwitchUserTests
testIdentifyUserSuccessfully_thenLogin_sendsCorrectTags - existing test migrated from other file
testAnonUser_thenIdentifyUserWithConflict_sendsCorrectUpdatesAndFetchesUser - Starts up with creating the anon user, then a login with conflict happens.
testAnonUser_thenIdentifyUserWithConflict_thenLogout_sendsCorrectUpdatesWithNoFetch - Starts up with creating the anon user, then a login with conflict happens, then a logout happens.
testAnonUser_thenIdentifyUserWithConflict_thenLogin_sendsCorrectUpdatesAndFetchesUser - Starts up with creating the anon user, then a login with conflict happens, then a login to another user happens.
Manual testing
None, app runs.
Affected code checklist
[ ] Notifications
[ ] Display
[ ] Open
[ ] Push Processing
[ ] Confirm Deliveries
[ ] Outcomes
[ ] Sessions
[ ] In-App Messaging
[ ] REST API requests
[ ] Public API changes
Checklist
Overview
[x] I have filled out all REQUIRED sections above
[x] PR does one thing
[x] Any Public API changes are explained in the PR details and conform to existing APIs
Testing
[x] I have included test coverage for these changes, or explained why they are not needed
[x] All automated tests pass, or I explained why that is not possible
[x] I have personally tested this on my device, or explained why that is not possible
Final pass
[x] Code is as readable as possible.
[x] I have reviewed this PR myself, ensuring it meets each checklist item
Description
One Line Summary
Add more complex user switching tests involving multiple calls to login / logout / user updates in a short span.
Details
Motivation
Scope
Unit tests
Testing
Unit testing
Added new test class
SwitchUserTests
testIdentifyUserSuccessfully_thenLogin_sendsCorrectTags
- existing test migrated from other filetestAnonUser_thenIdentifyUserWithConflict_sendsCorrectUpdatesAndFetchesUser
- Starts up with creating the anon user, then a login with conflict happens.testAnonUser_thenIdentifyUserWithConflict_thenLogout_sendsCorrectUpdatesWithNoFetch
- Starts up with creating the anon user, then a login with conflict happens, then a logout happens.testAnonUser_thenIdentifyUserWithConflict_thenLogin_sendsCorrectUpdatesAndFetchesUser
- Starts up with creating the anon user, then a login with conflict happens, then a login to another user happens.Manual testing
None, app runs.
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is