Skip to content

Commit

Permalink
fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
matthiasemde committed Nov 27, 2024
1 parent f575bba commit cfe8451
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
goalsSortMode = GoalsSortMode.DEFAULT,
goalsSortDirection = SortDirection.DEFAULT,
showPausedGoals = true,
metronomeSettings = MetronomeSettings.DEFAULT
metronomeSettings = MetronomeSettings.DEFAULT,
idOfLastAnnouncementSeen = 0
)
)
override val theme: Flow<ThemeSelections>
Expand Down Expand Up @@ -75,6 +76,9 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
override val metronomeSettings: Flow<MetronomeSettings>
get() = _preferences.map { it.metronomeSettings }

override val idOfLastAnnouncementSeen: Flow<Int>
get() = _preferences.map { it.idOfLastAnnouncementSeen }

override suspend fun updateTheme(theme: ThemeSelections) {
_preferences.update {
it.copy(theme = theme)
Expand Down Expand Up @@ -131,4 +135,10 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
it.copy(metronomeSettings = settings)
}
}

override suspend fun updateIdOfLastAnnouncementSeen(id: Int) {
_preferences.update {
it.copy(idOfLastAnnouncementSeen = id)
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,8 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
goalsSortMode = GoalsSortMode.Companion.DEFAULT,
goalsSortDirection = SortDirection.Companion.DEFAULT,
showPausedGoals = true,
metronomeSettings = MetronomeSettings.Companion.DEFAULT
metronomeSettings = MetronomeSettings.Companion.DEFAULT,
idOfLastAnnouncementSeen = 0
)
)
override val theme: Flow<ThemeSelections>
Expand Down Expand Up @@ -75,6 +76,9 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
override val metronomeSettings: Flow<MetronomeSettings>
get() = _preferences.map { it.metronomeSettings }

override val idOfLastAnnouncementSeen: Flow<Int>
get() = _preferences.map { it.idOfLastAnnouncementSeen }

override suspend fun updateTheme(theme: ThemeSelections) {
_preferences.update {
it.copy(theme = theme)
Expand Down Expand Up @@ -131,4 +135,10 @@ class FakeUserPreferencesRepository : UserPreferencesRepository {
it.copy(metronomeSettings = settings)
}
}

override suspend fun updateIdOfLastAnnouncementSeen(id: Int) {
_preferences.update {
it.copy(idOfLastAnnouncementSeen = id)
}
}
}

0 comments on commit cfe8451

Please sign in to comment.