diff options
Diffstat (limited to 'uitest/src/com/vaadin/tests/components/ui/InitiallyEmptyFragmentTest.java')
-rw-r--r-- | uitest/src/com/vaadin/tests/components/ui/InitiallyEmptyFragmentTest.java | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/tests/components/ui/InitiallyEmptyFragmentTest.java b/uitest/src/com/vaadin/tests/components/ui/InitiallyEmptyFragmentTest.java new file mode 100644 index 0000000000..fc948ab3db --- /dev/null +++ b/uitest/src/com/vaadin/tests/components/ui/InitiallyEmptyFragmentTest.java @@ -0,0 +1,30 @@ +package com.vaadin.tests.components.ui; + +import org.junit.Assert; +import org.junit.Test; + +import com.vaadin.tests.tb3.MultiBrowserTest; + +public class InitiallyEmptyFragmentTest extends MultiBrowserTest { + + @Override + protected Class<?> getUIClass() { + return InitialFragmentEvent.class; + } + + @Test + public void testNoFragmentChangeEventWhenInitiallyEmpty() throws Exception { + openTestURL(); + /* + * There is no fragment change event when the fragment is initially + * empty + */ + assertLogText(" "); + executeScript("window.location.hash='bar'"); + assertLogText("1. Fragment changed from \"no event received\" to bar"); + } + + private void assertLogText(String expected) { + Assert.assertEquals("Unexpected log contents,", expected, getLogRow(0)); + } +} |