react-native-star-rating
Version:
A React Native component for generating and displaying interactive star ratings
24 lines (17 loc) • 561 B
JavaScript
import React from 'react';
import renderer from 'react-test-renderer';
import StarRating from '../StarRating';
// https://medium.com/react-native-training/learning-to-test-react-native-with-jest-part-1-f782c4e30101
const baseProps = {};
const getMock = (props = {}) => {
const allProps = { ...baseProps, ...props };
return (
<StarRating {...allProps} />
);
};
describe('StarRating component', () => {
it('renders without crashing', () => {
const rendered = renderer.create(getMock()).toJSON();
expect(rendered).toBeTruthy();
});
});