Package org.uberfire.client.workbench.widgets.splash

Source Code of org.uberfire.client.workbench.widgets.splash.SplashViewTest

package org.uberfire.client.workbench.widgets.splash;

import com.github.gwtbootstrap.client.ui.event.HideHandler;
import com.google.gwt.user.client.ui.IsWidget;
import com.google.gwtmockito.GwtMockitoTestRunner;
import org.junit.Before;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.uberfire.client.workbench.widgets.common.Modal;

import static org.mockito.Mockito.*;

@RunWith(GwtMockitoTestRunner.class)
public class SplashViewTest {

    private SplashViewUnitTestWrapper splashViewUnitTestWrapper;

    @Before
    public void setup() {
        splashViewUnitTestWrapper = new SplashViewUnitTestWrapper();
    }


    @Test
      public void setContentDelegationTest() {
        Modal modal = splashViewUnitTestWrapper.getModal();
        IsWidget mock = mock( IsWidget.class );
        int height = 1;
        splashViewUnitTestWrapper.setContent( mock, height );

        verify( modal ).add( mock );
        verify( modal ).add( splashViewUnitTestWrapper.footer );
        verify( modal ).setBodyHeigth( height );
    }

    @Test
    public void showDelegationTest() {
        Modal modal = splashViewUnitTestWrapper.getModal();
        splashViewUnitTestWrapper.show();

        verify( modal ).show();
        verify( modal ).addHideHandler( any( HideHandler.class ) );
    }

    @Test
    public void hideDelegationTest() {
        Modal modal = splashViewUnitTestWrapper.getModal();
        splashViewUnitTestWrapper.hide();

        verify( modal ).hide();
    }



}
TOP

Related Classes of org.uberfire.client.workbench.widgets.splash.SplashViewTest

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.