You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

RichTextAreaStateTest.java 1.3KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445
  1. package com.vaadin.v7.tests.server.component.richtextarea;
  2. import static org.junit.Assert.assertEquals;
  3. import org.junit.Test;
  4. import com.vaadin.v7.shared.ui.textarea.RichTextAreaState;
  5. import com.vaadin.v7.ui.RichTextArea;
  6. /**
  7. * Tests for RichTextArea State.
  8. *
  9. */
  10. public class RichTextAreaStateTest {
  11. @Test
  12. public void getState_areaHasCustomState() {
  13. TestRichTextArea area = new TestRichTextArea();
  14. RichTextAreaState state = area.getState();
  15. assertEquals("Unexpected state class", RichTextAreaState.class,
  16. state.getClass());
  17. }
  18. @Test
  19. public void getPrimaryStyleName_areaHasCustomPrimaryStyleName() {
  20. RichTextArea area = new RichTextArea();
  21. RichTextAreaState state = new RichTextAreaState();
  22. assertEquals("Unexpected primary style name", state.primaryStyleName,
  23. area.getPrimaryStyleName());
  24. }
  25. @Test
  26. public void areaStateHasCustomPrimaryStyleName() {
  27. RichTextAreaState state = new RichTextAreaState();
  28. assertEquals("Unexpected primary style name", "v-richtextarea",
  29. state.primaryStyleName);
  30. }
  31. private static class TestRichTextArea extends RichTextArea {
  32. @Override
  33. public RichTextAreaState getState() {
  34. return super.getState();
  35. }
  36. }
  37. }