From 2a4a20a3cc6c68fb9349c45036041959c1b2183b Mon Sep 17 00:00:00 2001 From: twinh Date: Sun, 2 Jan 2022 22:46:22 +0800 Subject: [PATCH] =?UTF-8?q?test(a-button):=20=E5=A2=9E=E5=8A=A0=20`NewBtn`?= =?UTF-8?q?=20=E6=B5=8B=E8=AF=95?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- __tests__/NewBtn.js | 21 +++++++++++++++++++ __tests__/__snapshots__/NewBtn.js.snap | 28 ++++++++++++++++++++++++++ 2 files changed, 49 insertions(+) create mode 100644 __tests__/NewBtn.js create mode 100644 __tests__/__snapshots__/NewBtn.js.snap diff --git a/__tests__/NewBtn.js b/__tests__/NewBtn.js new file mode 100644 index 0000000..f9aa52b --- /dev/null +++ b/__tests__/NewBtn.js @@ -0,0 +1,21 @@ +import {NewBtn} from '../'; +import {MemoryRouter} from 'react-router'; +import {render} from '@testing-library/react'; + +describe('NewBtn', () => { + test('default', () => { + const {container} = render( + bar + ); + + expect(container).toMatchSnapshot(); + }); + + test('text', () => { + const {container} = render( + bar + ); + + expect(container).toMatchSnapshot(); + }); +}); diff --git a/__tests__/__snapshots__/NewBtn.js.snap b/__tests__/__snapshots__/NewBtn.js.snap new file mode 100644 index 0000000..d644db4 --- /dev/null +++ b/__tests__/__snapshots__/NewBtn.js.snap @@ -0,0 +1,28 @@ +// Jest Snapshot v1, https://goo.gl/fbAQLP + +exports[`NewBtn default 1`] = ` +
+ + + bar + + +
+`; + +exports[`NewBtn text 1`] = ` +
+ + + bar + + +
+`;