@Test public void testContextSpecificComponentAssertionPasses() { InternalNode.assertContextSpecificStyleNotSet(acquireInternalNode()); }
@Test public void testContextSpecificComponentAssertionFailFormatting() { final ComponentsLogger componentsLogger = mock(ComponentsLogger.class); final PerfEvent perfEvent = mock(PerfEvent.class); when(componentsLogger.newPerformanceEvent(anyInt())).thenReturn(perfEvent); InternalNode node = acquireInternalNodeWithLogger(componentsLogger); node.alignSelf(YogaAlign.AUTO); node.flex(1f); InternalNode.assertContextSpecificStyleNotSet(node); verify(componentsLogger) .emitMessage( ComponentsLogger.LogLevel.WARNING, "You should not set alignSelf, flex to a root layout in Column"); }
InternalNode.assertContextSpecificStyleNotSet(resolvedLayout);