Search in sources :

Example 51 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertNoAudioCallButtonInNonActiveConversation.

@Test
public void assertNoAudioCallButtonInNonActiveConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(false);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.action_audio_call)).check(CustomViewAssertions.isNull());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 52 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertAudioMessageIconVisibleInGroupConversation.

@Test
public void assertAudioMessageIconVisibleInGroupConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    when(mockConversation.isActive()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.cursor_menu_item_audio_message)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 53 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertFileUploadIconVisibleInGroupConversation.

@Test
public void assertFileUploadIconVisibleInGroupConversation() throws InterruptedException {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    when(mockConversation.isActive()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    Thread.sleep(500);
    onView(withId(R.id.cursor_menu_item_more)).perform(click());
    Thread.sleep(500);
    onView(withId(R.id.cursor_menu_item_file)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 54 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertCursorImagesVisible.

@Test
public void assertCursorImagesVisible() throws Exception {
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getType()).thenReturn(IConversation.Type.GROUP);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    when(mockConversation.isActive()).thenReturn(true);
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withId(R.id.cursor_menu_item_camera)).check(isVisible());
    onView(withId(R.id.cursor_menu_item_camera)).perform(click());
    Thread.sleep(500);
    onView(withId(R.id.rv__cursor_images)).check(isVisible());
}
Also used : IConversation(com.waz.api.IConversation) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Example 55 with IConversation

use of com.waz.api.IConversation in project wire-android by wireapp.

the class ConversationFragmentTest method assertToolbarOneToOneParticipants.

@Test
public void assertToolbarOneToOneParticipants() {
    String conversationName = "ConversationName";
    IConversation mockConversation = mock(IConversation.class);
    when(mockConversation.getName()).thenReturn(conversationName);
    when(mockConversation.getType()).thenReturn(IConversation.Type.ONE_TO_ONE);
    when(mockConversation.isMemberOfConversation()).thenReturn(true);
    IConversationScreenController mockScreenController = activity.getControllerFactory().getConversationScreenController();
    MockHelper.setupConversationMocks(mockConversation, activity);
    attachFragment(ConversationFragment.newInstance(), ConversationFragment.TAG);
    onView(withText(conversationName)).perform(click());
    verify(mockScreenController).showParticipants(any(View.class), anyBoolean());
}
Also used : IConversation(com.waz.api.IConversation) IConversationScreenController(com.waz.zclient.pages.main.conversation.controller.IConversationScreenController) View(android.view.View) Espresso.onView(android.support.test.espresso.Espresso.onView) FragmentTest(com.waz.zclient.testutils.FragmentTest) Test(org.junit.Test)

Aggregations

IConversation (com.waz.api.IConversation)69 FragmentTest (com.waz.zclient.testutils.FragmentTest)25 Test (org.junit.Test)25 GlobalTrackingController (com.waz.zclient.tracking.GlobalTrackingController)14 View (android.view.View)10 User (com.waz.api.User)9 ArrayList (java.util.ArrayList)6 SuppressLint (android.annotation.SuppressLint)5 Intent (android.content.Intent)4 Handler (android.os.Handler)4 AbsListView (android.widget.AbsListView)4 CreatedGroupConversationEvent (com.waz.zclient.controllers.tracking.events.group.CreatedGroupConversationEvent)4 FooterMenuCallback (com.waz.zclient.views.menus.FooterMenuCallback)4 Instrumentation (android.app.Instrumentation)3 TextView (android.widget.TextView)3 BaseScalaActivity (com.waz.zclient.BaseScalaActivity)3 AddedMemberToGroupEvent (com.waz.zclient.controllers.tracking.events.group.AddedMemberToGroupEvent)3 ExceptionHandler (net.hockeyapp.android.ExceptionHandler)3 Animator (android.animation.Animator)2 AnimatorSet (android.animation.AnimatorSet)2