OneSignal / OneSignal-iOS-SDK

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

Closed nan-li closed 6 months ago

nan-li commented 6 months ago

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

  1. testIdentifyUserSuccessfully_thenLogin_sendsCorrectTags - existing test migrated from other file
  2. testAnonUser_thenIdentifyUserWithConflict_sendsCorrectUpdatesAndFetchesUser - Starts up with creating the anon user, then a login with conflict happens.
  3. testAnonUser_thenIdentifyUserWithConflict_thenLogout_sendsCorrectUpdatesWithNoFetch - Starts up with creating the anon user, then a login with conflict happens, then a logout happens.
  4. 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 Reviewable