use of com.orgzly.android.LocalStorage in project orgzly-android by orgzly.
the class SavedSearchesFragmentTest method testExportSavedSearches.
@Test
public void testExportSavedSearches() throws IOException {
Intents.init();
// Uri to get back after sending Intent.ACTION_CREATE_DOCUMENT
DocumentFile file = DocumentFile.fromFile(new LocalStorage(context).downloadsDirectory("searches.json"));
Instrumentation.ActivityResult result = new Instrumentation.ActivityResult(Activity.RESULT_OK, new Intent().setData(file.getUri()));
intending(hasAction(Intent.ACTION_CREATE_DOCUMENT)).respondWith(result);
onActionItemClick(R.id.saved_searches_export, R.string.export);
onSnackbar().check(matches(withText(context.getResources().getQuantityString(R.plurals.exported_searches, 4, 4))));
Intents.release();
file.delete();
}
Aggregations