From e90ba40fa97e3ae553f96433708380e35a15787f Mon Sep 17 00:00:00 2001 From: louis Date: Mon, 28 Mar 2022 13:23:43 +0200 Subject: [PATCH] :camera_flash: Add Snapshot for ReloadInfo --- src/components/ReloadInfo.test.tsx | 22 +++++++ .../__snapshots__/ReloadInfo.test.tsx.snap | 59 +++++++++++++++++++ 2 files changed, 81 insertions(+) create mode 100644 src/components/ReloadInfo.test.tsx create mode 100644 src/components/__snapshots__/ReloadInfo.test.tsx.snap diff --git a/src/components/ReloadInfo.test.tsx b/src/components/ReloadInfo.test.tsx new file mode 100644 index 00000000..3cb7ecd2 --- /dev/null +++ b/src/components/ReloadInfo.test.tsx @@ -0,0 +1,22 @@ +import React from 'react' +import { render } from '@testing-library/react' +import { ReloadInfo } from './index' + +describe('ReloadInfo', function () { + beforeAll(function () { + localStorage.removeItem('showReloadInfo') + }) + + test('renders correctly', function () { + const { asFragment } = render() + + expect(asFragment()).toMatchSnapshot() + }) + + test('not renders if dismissed', function () { + localStorage.setItem('showReloadInfo', '0') + const { asFragment } = render() + + expect(asFragment()).toMatchSnapshot() + }) +}) diff --git a/src/components/__snapshots__/ReloadInfo.test.tsx.snap b/src/components/__snapshots__/ReloadInfo.test.tsx.snap new file mode 100644 index 00000000..b78707ff --- /dev/null +++ b/src/components/__snapshots__/ReloadInfo.test.tsx.snap @@ -0,0 +1,59 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`ReloadInfo not renders if dismissed 1`] = ` + +