Fix: forget the user’s consents for analytics on logout (#816)

* Fix: forget the user’s consents for analytics on logout

* Fix: change how analytics consent state is stored

* Fix: renaming of AnalyticsConsentState entries
This commit is contained in:
Nicolas Mauri
2023-04-21 17:05:39 +02:00
committed by GitHub
parent 078799c1e2
commit b432bd6fe4
8 changed files with 78 additions and 30 deletions
@@ -42,12 +42,13 @@ class AnalyticsSettingsScreenViewModelTests: XCTestCase {
}
func testOptIn() {
applicationSettings.analyticsConsentState = .optedOut
context.send(viewAction: .toggleAnalytics)
XCTAssertTrue(context.enableAnalytics)
}
func testOptOut() {
applicationSettings.enableAnalytics = true
applicationSettings.analyticsConsentState = .optedIn
context.send(viewAction: .toggleAnalytics)
XCTAssertFalse(context.enableAnalytics)
}