|
|
@@ -22,6 +22,7 @@ import java.io.IOException; |
|
|
|
import org.junit.Assert; |
|
|
|
import org.junit.Test; |
|
|
|
|
|
|
|
import com.vaadin.shared.ui.MarginInfo; |
|
|
|
import com.vaadin.shared.ui.label.ContentMode; |
|
|
|
import com.vaadin.tests.server.component.DeclarativeMarginTestBase; |
|
|
|
import com.vaadin.ui.Alignment; |
|
|
@@ -302,4 +303,26 @@ public class GridLayoutDeclarativeTest |
|
|
|
testWrite(design, gl); |
|
|
|
testRead(design, gl); |
|
|
|
} |
|
|
|
|
|
|
|
@Test |
|
|
|
public void testGridLayoutMargins() throws IOException { |
|
|
|
String design = "<vaadin-grid-layout _id=\"marginComponent\"margin>" |
|
|
|
+ "<row><column><vaadin-grid-layout _id=\"marginLeftComponent\" margin-left></vaadin-grid-layout></column></row>" |
|
|
|
+ "<row><column><vaadin-grid-layout _id=\"marginRightComponent\" margin-right></vaadin-grid-layout></column></row>" |
|
|
|
+ "<row><column><vaadin-grid-layout _id=\"marginTopComponent\" margin-top></vaadin-grid-layout></column></row>" |
|
|
|
+ "<row><column><vaadin-grid-layout _id=\"marginBottomComponent\" margin-bottom></vaadin-grid-layout></column></row>" |
|
|
|
+ "</vaadin-grid-layout>"; |
|
|
|
DesignContext context = Design |
|
|
|
.read(new ByteArrayInputStream(design.getBytes("UTF-8")), null); |
|
|
|
Assert.assertEquals(null, context.getCustomAttributes( |
|
|
|
context.getComponentByLocalId("marginComponent"))); |
|
|
|
Assert.assertEquals(null, context.getCustomAttributes( |
|
|
|
context.getComponentByLocalId("marginLeftComponent"))); |
|
|
|
Assert.assertEquals(null, context.getCustomAttributes( |
|
|
|
context.getComponentByLocalId("marginRightComponent"))); |
|
|
|
Assert.assertEquals(null, context.getCustomAttributes( |
|
|
|
context.getComponentByLocalId("marginTopComponent"))); |
|
|
|
Assert.assertEquals(null, context.getCustomAttributes( |
|
|
|
context.getComponentByLocalId("marginBottomComponent"))); |
|
|
|
} |
|
|
|
} |