Skip to content

Commit

Permalink
feat: added StakingCta test
Browse files Browse the repository at this point in the history
  • Loading branch information
Matt561 committed Sep 26, 2024
1 parent 8f0cf93 commit fba4c8c
Show file tree
Hide file tree
Showing 2 changed files with 177 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
import React from 'react';
import { screen, render } from '@testing-library/react-native';
import StakingCta from './StakingCta';

const mockNavigate = jest.fn();

jest.mock('@react-navigation/native', () => {
const actualReactNavigation = jest.requireActual('@react-navigation/native');
return {
...actualReactNavigation,
useNavigation: () => ({
navigate: mockNavigate,
}),
};
});
describe('StakingCta', () => {
it('render matches snapshot', () => {
render(<StakingCta estimatedRewardRate="2.6%" />);
expect(screen.toJSON()).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -0,0 +1,156 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`StakingCta render matches snapshot 1`] = `
<View>
<Text
style={
[
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 30,
"fontWeight": "400",
"marginVertical": 2,
},
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
undefined,
[
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Bold",
"fontSize": 18,
"fontWeight": "600",
"marginVertical": 3,
},
undefined,
undefined,
{
"fontFamily": "Euclid Circular B",
"fontSize": 16,
"fontWeight": "700",
"letterSpacing": 0,
"lineHeight": 24,
"marginVertical": 0,
"paddingBottom": 16,
"paddingTop": 14,
},
],
]
}
>
Stake ETH and earn
</Text>
<View
style={
{
"flexDirection": "row",
"flexWrap": "wrap",
}
}
>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Stake your ETH with MetaMask Pool and earn
 
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#1c8234",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
2.6%
</Text>
<Text
accessibilityRole="text"
style={
{
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
annually.
 
</Text>
<Text
accessibilityRole="link"
accessible={true}
onPress={[Function]}
onPressIn={[Function]}
onPressOut={[Function]}
style={
{
"backgroundColor": "transparent",
"color": "#141618",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
suppressHighlighting={true}
>
<Text
accessibilityRole="text"
style={
{
"color": "#0376c9",
"fontFamily": "EuclidCircularB-Regular",
"fontSize": 14,
"fontWeight": "400",
"letterSpacing": 0,
"lineHeight": 22,
}
}
>
Learn more.
</Text>
</Text>
</View>
</View>
`;

0 comments on commit fba4c8c

Please sign in to comment.