Skip to content

Commit

Permalink
LoyaltyCardViewActivityTest: Update test to handle MaterialDatePicker…
Browse files Browse the repository at this point in the history
… migration

Signed-off-by: Aayush Gupta <[email protected]>
  • Loading branch information
theimpulson committed Oct 24, 2023
1 parent 6905efc commit cc74ac8
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import android.app.Activity;
import android.app.DatePickerDialog;
import android.app.Dialog;
import android.content.Context;
import android.content.Intent;
import android.content.SharedPreferences;
Expand Down Expand Up @@ -725,9 +726,9 @@ public void startWithLoyaltyCardNoExpirySetExpiry() throws IOException {

shadowOf(getMainLooper()).idle();

DatePickerDialog datePickerDialog = (DatePickerDialog) (ShadowDialog.getLatestDialog());
Dialog datePickerDialog = ShadowDialog.getLatestDialog();
assertNotNull(datePickerDialog);
datePickerDialog.getButton(DatePickerDialog.BUTTON_POSITIVE).performClick();
datePickerDialog.findViewById(com.google.android.material.R.id.confirm_button).performClick();

shadowOf(getMainLooper()).idle();

Expand Down

0 comments on commit cc74ac8

Please sign in to comment.