Integration Tests: ensure that environment is sandbox#1730
Merged
Conversation
f50c690 to
da559e1
Compare
For some reason the url is `[app_bundle]/StoreKit/receipt` in integration tests. This is not correct, so I've added a couple of tests: one for entitlements, and another one to check the raw output value of that property. This is necessary to make sure that receipts are loaded correctly after #1726.
da559e1 to
9f96300
Compare
aboedo
approved these changes
Jun 22, 2022
Comment on lines
+41
to
+44
| // Mutable in tests so it can be overriden | ||
| static var `default`: SandboxEnvironmentDetector = BundleSandboxEnvironmentDetector() | ||
| #else | ||
| static let `default`: SandboxEnvironmentDetector = BundleSandboxEnvironmentDetector() |
Member
There was a problem hiding this comment.
var vs let here is clever! FWIW just having it be internal would likely have been enough for testing purposes, but this adds extra safety
Contributor
Author
There was a problem hiding this comment.
Exactly my thought :)
NachoSoto
commented
Jun 22, 2022
| return .disabled | ||
| } | ||
|
|
||
| func testIsSandbox() { |
Contributor
Author
There was a problem hiding this comment.
I moved this here so it runs in SK1 and SK2 separately, in case that logic ever diverges (like in iOS 16 potentially?)
NachoSoto
added a commit
that referenced
this pull request
Feb 9, 2023
… on simulator Thanks to @chrisvasselli for the find and initial implementation. This supersedes the workaround introduced in #1730, now making `IntegrationTests` not override the `SandboxEnvironmentDetector`.
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.
For some reason the url is
[app_bundle]/StoreKit/receiptin integration tests.This is not correct, so I've added a couple of tests: one for entitlements, and another one to check the raw output value of that property.
This is necessary to make sure that receipts are loaded correctly after #1726.