-
-
Notifications
You must be signed in to change notification settings - Fork 338
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(replay): MaskAll* set to false should unmask all
- Loading branch information
1 parent
0b19589
commit 36f4d74
Showing
2 changed files
with
34 additions
and
4 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -67,8 +67,8 @@ final class RNSentryReplayOptions: XCTestCase { | |
XCTAssertEqual(replayOptions.count, 5) | ||
XCTAssertNotNil(replayOptions["sessionSampleRate"]) | ||
XCTAssertNotNil(replayOptions["errorSampleRate"]) | ||
XCTAssertNotNil(replayOptions["redactAllImages"]) | ||
XCTAssertNotNil(replayOptions["redactAllText"]) | ||
XCTAssertNotNil(replayOptions["maskAllImages"]) | ||
XCTAssertNotNil(replayOptions["maskAllText"]) | ||
XCTAssertNotNil(replayOptions["maskedViewClasses"]) | ||
} | ||
|
||
|
@@ -133,6 +133,21 @@ final class RNSentryReplayOptions: XCTestCase { | |
XCTAssertEqual(ObjectIdentifier(actualOptions.experimental.sessionReplay.maskedViewClasses[0]), ObjectIdentifier(NSClassFromString("RCTImageView")!)) | ||
} | ||
|
||
func testMaskAllImagesFalse() { | ||
let optionsDict = ([ | ||
"dsn": "https://[email protected]/1234567", | ||
"_experiments": [ "replaysOnErrorSampleRate": 0.75 ], | ||
"mobileReplayOptions": [ "maskAllImages": false ] | ||
] as NSDictionary).mutableCopy() as! NSMutableDictionary | ||
|
||
RNSentryReplay.updateOptions(optionsDict) | ||
|
||
let actualOptions = try! Options(dict: optionsDict as! [String: Any]) | ||
|
||
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskAllImages, false) | ||
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskedViewClasses.count, 0) | ||
} | ||
|
||
func testMaskAllText() { | ||
let optionsDict = ([ | ||
"dsn": "https://[email protected]/1234567", | ||
|
@@ -152,4 +167,19 @@ final class RNSentryReplayOptions: XCTestCase { | |
XCTAssertEqual(ObjectIdentifier(actualOptions.experimental.sessionReplay.maskedViewClasses[1]), ObjectIdentifier(NSClassFromString("RCTParagraphComponentView")!)) | ||
} | ||
|
||
func testMaskAllTextFalse() { | ||
let optionsDict = ([ | ||
"dsn": "https://[email protected]/1234567", | ||
"_experiments": [ "replaysOnErrorSampleRate": 0.75 ], | ||
"mobileReplayOptions": [ "maskAllText": false ] | ||
] as NSDictionary).mutableCopy() as! NSMutableDictionary | ||
|
||
RNSentryReplay.updateOptions(optionsDict) | ||
|
||
let actualOptions = try! Options(dict: optionsDict as! [String: Any]) | ||
|
||
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskAllText, false) | ||
XCTAssertEqual(actualOptions.experimental.sessionReplay.maskedViewClasses.count, 0) | ||
} | ||
|
||
} |
This file contains 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