fixed test case save draft

This commit is contained in:
Mariotaku Lee 2017-08-25 14:26:49 +08:00
parent bf0b621c16
commit 9ecafb2447
No known key found for this signature in database
GPG Key ID: 15C10F89D7C33535
2 changed files with 10 additions and 0 deletions

View File

@ -61,6 +61,7 @@ class ComposeActivityTest {
val statusUpdate = activity.getStatusUpdateTest(false)
Assert.assertEquals("Test Reply", statusUpdate.text)
assertExcludedMatches(emptyArray(), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}
@ -80,6 +81,7 @@ class ComposeActivityTest {
val statusUpdate = activity.getStatusUpdateTest(false)
Assert.assertEquals("Test Reply", statusUpdate.text)
assertExcludedMatches(arrayOf("17484680", "57610574"), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}
@ -101,6 +103,7 @@ class ComposeActivityTest {
Assert.assertEquals("https://twitter.com/t_deyarmin/status/847950697987493888",
statusUpdate.attachment_url)
assertExcludedMatches(emptyArray(), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}
@ -120,6 +123,7 @@ class ComposeActivityTest {
val statusUpdate = activity.getStatusUpdateTest(false)
Assert.assertEquals("Test Reply", statusUpdate.text)
assertExcludedMatches(emptyArray(), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}
@ -139,6 +143,7 @@ class ComposeActivityTest {
val statusUpdate = activity.getStatusUpdateTest(false)
Assert.assertEquals("Test Reply", statusUpdate.text)
assertExcludedMatches(arrayOf("57610574"), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}
@ -158,6 +163,7 @@ class ComposeActivityTest {
val statusUpdate = activity.getStatusUpdateTest(false)
Assert.assertEquals("Test Reply", statusUpdate.text)
assertExcludedMatches(arrayOf("583328497", "57610574"), statusUpdate)
activity.requestSkipDraft()
activity.finish()
}

View File

@ -756,6 +756,10 @@ class ComposeActivity : BaseActivity(), OnMenuItemClickListener, OnClickListener
mediaPreviewAdapter.setAltText(position, altText)
}
internal fun requestSkipDraft() {
shouldSkipDraft = true
}
private fun locationMenuItemSelected(item: MenuItem) {
item.isChecked = true
var attachLocationChecked = false