chore(tests): Add in app messaging testing infrastructure and tests#1615
Merged
chore(tests): Add in app messaging testing infrastructure and tests#1615
Conversation
a69c00c to
f828623
Compare
1dee76e to
be40d3d
Compare
Contributor
Author
|
Failing tests: |
jkasten2
requested changes
Dec 1, 2025
Comment on lines
113
to
118
| - (void)overrideWebViewContentFinishedLoading:(OSInAppMessageInternal *)message { | ||
| if (message) { | ||
| [OSMessagingController.sharedInstance messageViewImpressionRequest:message]; | ||
| // [OSMessagingController.sharedInstance messageViewImpressionRequest:message]; | ||
| } | ||
| } |
Member
There was a problem hiding this comment.
This method does nothing now, can we remove it?
Contributor
Author
There was a problem hiding this comment.
I was testing something, didn't mean to commit this one change, I'll undo it.
Comment on lines
1425
to
1444
| @@ -1440,6 +1441,7 @@ of this software and associated documentation files (the "Software"), to deal | |||
| // XCTAssertEqual(OSMessagingControllerOverrider.messageDisplayQueue.count, 1); | |||
| // } | |||
|
|
|||
| /// ✅ Migrated to `testPreviewIAMIsDisplayedOnPause` | |||
Member
There was a problem hiding this comment.
Can we remove this code if it as been migrated?
Contributor
Author
There was a problem hiding this comment.
Yes, that makes sense
12491ad to
19374af
Compare
Add Swift `IAMIntegrationTests` test file and check for accessibility of `OSMessagingController` from the test file
* no longer used, dead code
* Aren't called by anything so no need to be on the interface, these are called by the class itself.
* Without a description, the object will return something like `<OSRequestGetInAppMessages: 0x600001798bc0>`. By adding a predictable description, we can operate on the object.
* Re-usable test helpers and mock functionality * Include own swiftlint file * ❗️ After `OneSignalInAppMessagesMocks` was created, I had to then manually "convert to group" or else the CI had build errors about the following: xcodebuild: error: Unable to read project 'OneSignal.xcodeproj' Reason: The project ‘OneSignal’ is damaged and cannot be opened. Examine the project file for invalid edits or unresolved source control conflicts. Exception: didn't find classname for 'isa' key
…alInAppMessages * This extension on `UIApplication` is only used in the `OneSignalInAppMessages` framework, so there is no need to keep it in the umbrella `OneSignalFramework` framework, which causes errors if only `OneSignalInAppMessages` is tested (without also importing OneSignalFramework).
* Has helper methods for repeating functionality
* Attempt to migrate `testDisablingIAMs_stillCreatesMessageQueue_butPreventsMessageDisplay` to new tests, but behavior has changed. It becomes `testPausingIAMs_doesNotCreateMessageQueue` * Migrate `testPreviewIAMIsDisplayedOnPause`
* `messageViewImpressionRequest` was removed from the `OSMessagingController` header file, so update `OSMessagingControllerOverrider` to expose it for internal usage. * Delete old tests that have been migrated
19374af to
2267465
Compare
jkasten2
approved these changes
Dec 3, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
One Line Summary
Add basic infrastructure to test the
OneSignalInAppMessagesmodule, and begin migrating tests.Details
OneSignalInAppMessagesusing Swift language, primarily.Motivation
Increase tests, porting over tests.
Scope
Testing only, not changing the shipped SDK, or making any internal APIs public.
Testing
Unit testing
IAMIntegrationTestsand migrate 2 integration teststestDisablingIAMs_stillCreatesMessageQueue_butPreventsMessageDisplayto new tests, but behavior has changed. It becomestestPausingIAMs_doesNotCreateMessageQueue.OneSignalInAppMessagesMocksfor re-usable test helpers and mock functionalityConsistencyManagerTestHelperswith methods for repeating functionalityManual testing
Affected code checklist
Checklist
Overview
Testing
Final pass
This change is