Skip to content

Commit

Permalink
change show pomodoro button to true by default
Browse files Browse the repository at this point in the history
  • Loading branch information
Razeeman committed Aug 10, 2024
1 parent 564a454 commit e324b0a
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 31 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -24,26 +24,11 @@ import com.example.util.simpletimetracker.R as coreR
@RunWith(AndroidJUnit4::class)
class RecordRepeatTest : BaseUiTest() {

@Test
fun visibility() {
val type = "type"

// Add data
testUtils.addActivity(type)
Thread.sleep(1000)

// No records - no button
checkViewIsDisplayed(withText(coreR.string.running_records_add_type))
checkViewDoesNotExist(withText(coreR.string.running_records_repeat))

// Add record
testUtils.addRecord(type)
NavUtils.openRecordsScreen()
checkViewIsDisplayed(allOf(withText(type), isCompletelyDisplayed()))

// Button is shown
NavUtils.openRunningRecordsScreen()
checkViewIsDisplayed(withText(coreR.string.running_records_repeat))
override fun setUp() {
super.setUp()
runBlocking {
prefsInteractor.setEnableRepeatButton(true)
}
}

@Test
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2021,12 +2021,12 @@ class SettingsTest : BaseUiTest() {
NavUtils.openSettingsScreen()
NavUtils.openSettingsDisplay()
scrollSettingsRecyclerToText(coreR.string.settings_enable_pomodoro_mode)
checkCheckboxIsNotChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))
checkCheckboxIsChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))

// Not visible
// Visible
NavUtils.openRunningRecordsScreen()
tryAction {
checkViewDoesNotExist(
checkViewIsDisplayed(
allOf(
withId(R.id.viewRecordTypeItem),
hasDescendant(withText(R.string.running_records_pomodoro)),
Expand All @@ -2037,10 +2037,10 @@ class SettingsTest : BaseUiTest() {
// Change
NavUtils.openSettingsScreen()
clickOnSettingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode)
checkCheckboxIsChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))
checkCheckboxIsNotChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))
NavUtils.openRunningRecordsScreen()
tryAction {
checkViewIsDisplayed(
checkViewDoesNotExist(
allOf(
withId(R.id.viewRecordTypeItem),
hasDescendant(withText(R.string.running_records_pomodoro)),
Expand All @@ -2051,10 +2051,10 @@ class SettingsTest : BaseUiTest() {
// Change
NavUtils.openSettingsScreen()
clickOnSettingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode)
checkCheckboxIsNotChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))
checkCheckboxIsChecked(settingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode))
NavUtils.openRunningRecordsScreen()
tryAction {
checkViewDoesNotExist(
checkViewIsDisplayed(
allOf(
withId(R.id.viewRecordTypeItem),
hasDescendant(withText(R.string.running_records_pomodoro)),
Expand All @@ -2078,8 +2078,6 @@ class SettingsTest : BaseUiTest() {
NavUtils.openSettingsScreen()
NavUtils.openSettingsDisplay()
scrollSettingsRecyclerToText(coreR.string.settings_enable_pomodoro_mode)
clickOnSettingsCheckboxBesideText(coreR.string.settings_enable_pomodoro_mode)
scrollSettingsRecyclerToText(coreR.string.settings_enable_pomodoro_mode)
clickOnSettingsButtonBesideText(coreR.string.settings_enable_pomodoro_mode)
Thread.sleep(1000)
clickOnViewWithText(name1)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ import com.example.util.simpletimetracker.feature_statistics_detail.R as statist
@Suppress("SameParameterValue")
@HiltAndroidTest
@RunWith(AndroidJUnit4::class)
class RecordsFilterTest : BaseUiTest() {
class StatisticsDetailFilterTest : BaseUiTest() {

@Test
fun filterByType() {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@ object NavUtils {
}

fun openDataEditScreen() {
openSettingsAdditional()
scrollSettingsRecyclerToText(coreR.string.settings_data_edit)
clickOnSettingsRecyclerText(coreR.string.settings_data_edit)
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class PrefsRepoImpl @Inject constructor(
)

override var enablePomodoroMode: Boolean by prefs.delegate(
KEY_ENABLE_POMODORO_MODE, false,
KEY_ENABLE_POMODORO_MODE, true,
)

override var pomodoroModeStartedTimestamp: Long by prefs.delegate(
Expand Down

0 comments on commit e324b0a

Please sign in to comment.