INNER CODE UNIT · JavaScript

masonry

brh55/react-native-masonry · __tests__/masonry.test.js:19

  const masonry = renderer.create(<Masonry bricks={brickSet} columns={3} />).toJSON();
  // First child should the scroll view
  const scrollView = masonry.children[0];
  expect(scrollView.type).toBe('RCTScrollView');

  // Crucial styles for the grid to work
  expect(scrollView.props.contentContainerStyle).toEqual({
    justifyContent: 'space-between',
    flexDirection: 'row',
    width: '100%'
  });
});

test('SNAPSHOT: All functionality should match prev snapshot', () => {
  const tree = renderer.create(<Masonry bricks={brickSet} columns={3} />).toJSON();
  expect(tree).toMatchSnapshot();
});

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…