-
Notifications
You must be signed in to change notification settings - Fork 157
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fix telemetry opt-out through attribution dialog (better fix)
- Loading branch information
Vadim Yeshkunov
committed
Oct 13, 2021
1 parent
d84adc3
commit 17324af
Showing
7 changed files
with
52 additions
and
9 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
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
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
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
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
27 changes: 27 additions & 0 deletions
27
Tests/MapboxMapsTests/Foundation/Events/EventsManagerTests.swift
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 |
---|---|---|
@@ -0,0 +1,27 @@ | ||
import XCTest | ||
@testable import MapboxMaps | ||
|
||
final class EventsManagerTests: XCTestCase { | ||
|
||
let eventsManager = EventsManager(accessToken: "empty") | ||
|
||
override class func setUp() { | ||
UserDefaults.mme_configuration().set(true, forKey: "MMECollectionEnabledInSimulator") | ||
} | ||
|
||
func testUserDefaultsDynamicProperty() { | ||
UserDefaults.standard.MGLMapboxMetricsEnabled = true | ||
XCTAssertEqual(UserDefaults.standard.bool(forKey: "MGLMapboxMetricsEnabled"), true) | ||
|
||
UserDefaults.standard.MGLMapboxMetricsEnabled = false | ||
XCTAssertEqual(UserDefaults.standard.bool(forKey: "MGLMapboxMetricsEnabled"), false) | ||
} | ||
|
||
func testMGLMapboxMetricsEqualsMMECollectionEnabled() { | ||
UserDefaults.standard.MGLMapboxMetricsEnabled = true | ||
XCTAssertEqual(UserDefaults.mme_configuration().mme_isCollectionEnabled, true) | ||
|
||
UserDefaults.standard.MGLMapboxMetricsEnabled = false | ||
XCTAssertEqual(UserDefaults.mme_configuration().mme_isCollectionEnabled, false) | ||
} | ||
} |
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