always call tear down (#1909)

This commit is contained in:
Mauro
2023-10-16 17:28:06 +02:00
committed by GitHub
parent 64f5122d32
commit 1a08f9cac0
3 changed files with 9 additions and 1 deletions

View File

@@ -25,7 +25,7 @@ class AnalyticsSettingsScreenViewModelTests: XCTestCase {
private var context: AnalyticsSettingsScreenViewModelType.Context!
override func tearDown() {
appSettings.analyticsConsentState = .unknown
AppSettings.reset()
}
@MainActor override func setUpWithError() throws {

View File

@@ -37,6 +37,10 @@ class AnalyticsTests: XCTestCase {
bugReportService: ServiceLocator.shared.bugReportService))
}
override func tearDown() {
AppSettings.reset()
}
func testAnalyticsPromptNewUser() {
// Given a fresh install of the app (without PostHog analytics having been set).
// When the user is prompted for analytics.

View File

@@ -41,6 +41,10 @@ class ComposerToolbarViewModelTests: XCTestCase {
appSettings: appSettings,
mentionDisplayHelper: ComposerMentionDisplayHelper.mock)
}
override func tearDown() {
AppSettings.reset()
}
func testComposerFocus() {
viewModel.process(roomAction: .setMode(mode: .edit(originalItemId: TimelineItemIdentifier(timelineID: "mock"))))