react95-native
Version:
Refreshed Windows 95 style UI components for your React Native app
50 lines • 1.53 kB
JavaScript
import React from 'react';
import { render } from '@testing-library/react-native';
import { Fieldset, Text } from '../..';
describe('<Fieldset />', () => {
it('should render children', () => {
const {
getByTestId
} = render( /*#__PURE__*/React.createElement(Fieldset, {
testID: "fieldset"
}, /*#__PURE__*/React.createElement(Text, null, "Banana dance")));
expect(getByTestId('fieldset')).toHaveTextContent('Banana dance');
});
it('should render custom styles', () => {
const style = {
backgroundColor: 'teal'
};
const {
getByTestId
} = render( /*#__PURE__*/React.createElement(Fieldset, {
testID: "fieldset",
style: style
}, /*#__PURE__*/React.createElement(Text, null, "Fieldset")));
expect(getByTestId('fieldset')).toHaveStyle(style);
});
describe('prop: label', () => {
it('should render label', () => {
const {
getByText
} = render( /*#__PURE__*/React.createElement(Fieldset, {
label: "Something:"
}));
expect(getByText('Something:')).toBeTruthy();
});
});
describe('prop: labelStyle', () => {
it('should render custom label styles', () => {
const style = {
backgroundColor: 'teal'
};
const {
getByText
} = render( /*#__PURE__*/React.createElement(Fieldset, {
label: "Something:",
labelStyle: style
}));
expect(getByText('Something:')).toHaveStyle(style);
});
});
});
//# sourceMappingURL=Fieldset.spec.js.map