Fix failing UI test
Some checks failed
Build & Test / Validate (pull_request) Successful in 15s
Build & Test / Run Unit Tests (pull_request) Failing after 8m52s
Build & Test / Run UI Tests (pull_request) Successful in 16m38s

This commit is contained in:
William Brawner 2024-08-02 16:11:51 -06:00
parent b0e8ebbf71
commit 840ebc4fd1
Signed by: wbrawner
GPG key ID: 8FF12381C6C90D35
2 changed files with 5 additions and 2 deletions

View file

@ -235,7 +235,9 @@ class MarkdownTests {
val markdownMatcher = SemanticsMatcher("Markdown = [$markdown]") { val markdownMatcher = SemanticsMatcher("Markdown = [$markdown]") {
it.config.getOrNull(SemanticsProperties.EditableText)?.text == markdown it.config.getOrNull(SemanticsProperties.EditableText)?.text == markdown
} }
onNode(hasSetTextAction()).assert(markdownMatcher) onNode(hasSetTextAction()).waitUntil {
assert(markdownMatcher)
}
} }
private fun ComposeTestRule.openPreview() = onNodeWithText("Preview").performClick() private fun ComposeTestRule.openPreview() = onNodeWithText("Preview").performClick()

View file

@ -209,7 +209,8 @@ class MarkdownViewModel(
)) ))
return return
} }
_state.value = EditorState(fileName = untitledFileName) _state.value =
EditorState(fileName = untitledFileName, reloadToggle = _state.value.reloadToggle.inv())
Timber.i("Removing autosave uri from shared prefs") Timber.i("Removing autosave uri from shared prefs")
preferenceHelper[Preference.AUTOSAVE_URI] = null preferenceHelper[Preference.AUTOSAVE_URI] = null
} }