Skip to content

Commit

Permalink
Merge branch 'develop' into enumfilter
Browse files Browse the repository at this point in the history
  • Loading branch information
adhiamboperes authored Nov 15, 2024
2 parents 12e17b8 + 8a7fe0a commit ae222c6
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 6 deletions.
11 changes: 10 additions & 1 deletion .github/workflows/comment_coverage_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@ jobs:
check_code_coverage_completed:
name: Check code coverage completed
runs-on: ubuntu-latest
outputs:
conclusion: ${{ steps.wait-for-coverage.outputs.run-conclusion }}
steps:
- name: Wait for code coverage to complete
id: wait-for-coverage
Expand All @@ -27,6 +29,13 @@ jobs:
allowed-conclusions: |
success
failure
action_required
- name: Conclusion Analysis
if: steps.wait-for-coverage.outputs.run-conclusion == 'action_required'
run: |
echo "::error::First-time contributor workflows require manual approval. After approval, please re-run the comment coverage workflows to post the coverage report."
exit 1
comment_coverage_report:
name: Comment Code Coverage Report
Expand Down Expand Up @@ -60,7 +69,7 @@ jobs:
const run = runs[0];
if(!run) {
core.setFailed('Could not find a succesful workflow run for the PR');
core.setFailed('Could not find a successful workflow run for the PR');
return;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,6 @@ class ExitProfileDialogFragment : InjectableDialogFragment() {
dialog.dismiss()
}
.setPositiveButton(R.string.home_activity_back_dialog_exit) { _, _ ->
// TODO(#3641): Investigate on using finish instead of intent.
val intent = ProfileChooserActivity.createProfileChooserActivity(activity!!)
if (!restoreLastCheckedItem) {
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,7 @@ class AddProfileActivity : InjectableAutoLocalizedAppCompatActivity() {
}

override fun onSupportNavigateUp(): Boolean {
// TODO(#3641): Investigate on using finish instead of intent.
val intent = Intent(this, ProfileChooserActivity::class.java)
intent.addFlags(Intent.FLAG_ACTIVITY_CLEAR_TOP)
startActivity(intent)
finish()
return false
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@ import androidx.appcompat.app.AppCompatActivity
import androidx.test.core.app.ActivityScenario.launch
import androidx.test.core.app.ApplicationProvider
import androidx.test.espresso.Espresso.onView
import androidx.test.espresso.action.ViewActions
import androidx.test.espresso.action.ViewActions.click
import androidx.test.espresso.action.ViewActions.closeSoftKeyboard
import androidx.test.espresso.action.ViewActions.pressImeActionButton
Expand Down Expand Up @@ -1748,6 +1749,15 @@ class AddProfileActivityTest {
assertThat(currentScreenName).isEqualTo(ScreenName.ADD_PROFILE_ACTIVITY)
}

@Test
fun testAddProfileActivity_onBackPressed_finishActivity() {
val scenario = launch(AddProfileActivity::class.java)
onView(isRoot()).perform(ViewActions.pressBack())
testCoroutineDispatchers.runCurrent()
scenario.onActivity { activity ->
assertThat(activity.isFinishing).isTrue()
}
}
private fun createAddProfileActivityIntent(): Intent {
return AddProfileActivity.createAddProfileActivityIntent(
ApplicationProvider.getApplicationContext(),
Expand Down

0 comments on commit ae222c6

Please sign in to comment.