Skip to content

Commit

Permalink
fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Jeremy Hamilton committed Mar 14, 2021
1 parent d3341cc commit 7802eef
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 23 deletions.
13 changes: 0 additions & 13 deletions src/buttons/__tests__/Button.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,19 +53,6 @@ describe('Button Component', () => {
jest.resetModules();
});

it('should warn the user when using linearGradient without it installed', () => {
console.error = jest.fn();
shallow(
<Button
theme={theme}
linearGradientProps={{ colors: ['#4c669f', '#3b5998', '#192f6a'] }}
/>
);
expect(console.error).toHaveBeenCalledWith(
"You need to pass a ViewComponent to use linearGradientProps !\nExample: ViewComponent={require('react-native-linear-gradient')}"
);
});

describe('Button Types', () => {
describe('Solid', () => {
it('should display solid button', () => {
Expand Down
19 changes: 9 additions & 10 deletions src/social/SocialIcon.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -161,17 +161,16 @@ const SocialIcon: React.FunctionComponent<SocialIconProps> = (props) => {
])}
>
<View style={styles.wrapper}>
{
(shouldShowExpandedButton || !loading) &&
{(shouldShowExpandedButton || !loading) && (
<Icon
//@ts-ignore
iconStyle={StyleSheet.flatten([iconStyle && iconStyle])}
color={light ? colors[type] : iconColor}
name={type}
size={iconSize}
type={iconType}
//@ts-ignore
iconStyle={StyleSheet.flatten([iconStyle && iconStyle])}
color={light ? colors[type] : iconColor}
name={type}
size={iconSize}
type={iconType}
/>
}
)}
{shouldShowExpandedButton && (
<Text
//@ts-ignore
Expand All @@ -194,7 +193,7 @@ const SocialIcon: React.FunctionComponent<SocialIconProps> = (props) => {
styles.activityIndicatorStyle,
activityIndicatorStyle,
])}
color={light ? colors[type] : iconColor}
color={light ? colors[type] : iconColor || 'white'}
size={(small && 'small') || 'large'}
/>
)}
Expand Down

0 comments on commit 7802eef

Please sign in to comment.