Skip to content

Commit

Permalink
fix test code
Browse files Browse the repository at this point in the history
  • Loading branch information
crane-hiromu committed Aug 18, 2022
1 parent 5eaa769 commit ebe8052
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 7 deletions.
3 changes: 2 additions & 1 deletion App/Screens/MainApp.swift
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@ struct MainApp: App {

var body: some Scene {
WindowGroup {
router.routeToRoot()
PlaygroundTester.PlaygroundTesterView()
// router.routeToRoot()
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -7,15 +7,10 @@ import Foundation
@objcMembers
final class AppearanceSettingsViewModelTest: TestCase {

// MARK: Property

private let userDefaults: UserDefaults = .init(suiteName: "test") ?? .standard

// MARK: Test

func testAppearanceMode() {
// type: .light
do {
let userDefaults: UserDefaults = .init(suiteName: "test_light") ?? .standard
let viewModel = AppearanceSettingsViewModel(binding: .init(
appearanceMode: .light,
userDefaults: userDefaults
Expand All @@ -25,6 +20,7 @@ final class AppearanceSettingsViewModelTest: TestCase {

// type: .dark
do {
let userDefaults: UserDefaults = .init(suiteName: "test_dark") ?? .standard
let viewModel = AppearanceSettingsViewModel(binding: .init(
appearanceMode: .dark,
userDefaults: userDefaults
Expand All @@ -34,6 +30,7 @@ final class AppearanceSettingsViewModelTest: TestCase {

// type: .auto
do {
let userDefaults: UserDefaults = .init(suiteName: "test_auto") ?? .standard
let viewModel = AppearanceSettingsViewModel(binding: .init(
appearanceMode: .auto,
userDefaults: userDefaults
Expand Down

0 comments on commit ebe8052

Please sign in to comment.