From fba4c8c977c997fa0df04329510bab192c85f2f6 Mon Sep 17 00:00:00 2001 From: Matthew Grainger Date: Thu, 26 Sep 2024 13:26:08 -0400 Subject: [PATCH] feat: added StakingCta test --- .../StakingCta/StakingCta.test.tsx | 21 +++ .../__snapshots__/StakingCta.test.tsx.snap | 156 ++++++++++++++++++ 2 files changed, 177 insertions(+) create mode 100644 app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.test.tsx create mode 100644 app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap diff --git a/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.test.tsx b/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.test.tsx new file mode 100644 index 00000000000..8415d7bd14e --- /dev/null +++ b/app/components/UI/Stake/components/StakingBalance/StakingCta/StakingCta.test.tsx @@ -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(); + expect(screen.toJSON()).toMatchSnapshot(); + }); +}); diff --git a/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap b/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap new file mode 100644 index 00000000000..69ebef249b5 --- /dev/null +++ b/app/components/UI/Stake/components/StakingBalance/StakingCta/__snapshots__/StakingCta.test.tsx.snap @@ -0,0 +1,156 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`StakingCta render matches snapshot 1`] = ` + + + Stake ETH and earn + + + + Stake your ETH with MetaMask Pool and earn +   + + + 2.6% + + + annually. +   + + + + Learn more. + + + + +`;