use of io.github.hidroh.materialistic.test.shadow.ShadowFloatingActionButton in project materialistic by hidroh.
the class ItemActivityTest method testFullscreen.
@Config(shadows = { ShadowFloatingActionButton.class })
@Test
public void testFullscreen() {
Intent intent = new Intent();
WebItem webItem = new TestWebItem() {
@Override
public String getUrl() {
return "http://example.com";
}
@Override
public String getId() {
return "1";
}
};
intent.putExtra(ItemActivity.EXTRA_ITEM, webItem);
controller.withIntent(intent).create().start().resume().visible();
ShadowFloatingActionButton shadowFab = (ShadowFloatingActionButton) ShadowExtractor.extract(activity.findViewById(R.id.reply_button));
assertTrue(shadowFab.isVisible());
ShadowLocalBroadcastManager.getInstance(activity).sendBroadcast(new Intent(WebFragment.ACTION_FULLSCREEN).putExtra(WebFragment.EXTRA_FULLSCREEN, true));
assertFalse(shadowFab.isVisible());
ShadowLocalBroadcastManager.getInstance(activity).sendBroadcast(new Intent(WebFragment.ACTION_FULLSCREEN).putExtra(WebFragment.EXTRA_FULLSCREEN, false));
assertTrue(shadowFab.isVisible());
}
Aggregations