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

View File

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