diff --git a/app/src/androidTest/kotlin/com/wbrawner/simplemarkdown/MarkdownTests.kt b/app/src/androidTest/kotlin/com/wbrawner/simplemarkdown/MarkdownTests.kt index 6aba4f9..a3876b7 100644 --- a/app/src/androidTest/kotlin/com/wbrawner/simplemarkdown/MarkdownTests.kt +++ b/app/src/androidTest/kotlin/com/wbrawner/simplemarkdown/MarkdownTests.kt @@ -235,7 +235,9 @@ class MarkdownTests { val markdownMatcher = SemanticsMatcher("Markdown = [$markdown]") { it.config.getOrNull(SemanticsProperties.EditableText)?.text == markdown } - onNode(hasSetTextAction()).assert(markdownMatcher) + onNode(hasSetTextAction()).waitUntil { + assert(markdownMatcher) + } } private fun ComposeTestRule.openPreview() = onNodeWithText("Preview").performClick() diff --git a/app/src/main/java/com/wbrawner/simplemarkdown/MarkdownViewModel.kt b/app/src/main/java/com/wbrawner/simplemarkdown/MarkdownViewModel.kt index ee6fb09..c2d0955 100644 --- a/app/src/main/java/com/wbrawner/simplemarkdown/MarkdownViewModel.kt +++ b/app/src/main/java/com/wbrawner/simplemarkdown/MarkdownViewModel.kt @@ -209,7 +209,8 @@ class MarkdownViewModel( )) return } - _state.value = EditorState(fileName = untitledFileName) + _state.value = + EditorState(fileName = untitledFileName, reloadToggle = _state.value.reloadToggle.inv()) Timber.i("Removing autosave uri from shared prefs") preferenceHelper[Preference.AUTOSAVE_URI] = null }