From fa6e9ad73982fdbc3f04825a663da38b9175f98c Mon Sep 17 00:00:00 2001 From: Wenhao Ji Date: Sat, 14 Dec 2024 11:00:17 -0800 Subject: [PATCH] Added simple cases for JSX components to increase the coverage --- src/components/ActionButton.test.tsx | 7 +++++++ src/components/Avatar.test.tsx | 7 +++++++ src/components/CardImage.test.tsx | 7 +++++++ src/components/ChipImage.test.tsx | 7 +++++++ src/components/GithubProjectLink.test.tsx | 7 +++++++ src/components/MessageBar.test.tsx | 12 ++++++++++++ src/components/Modal.test.tsx | 7 +++++++ src/components/PlayerAvatar.test.tsx | 7 +++++++ src/components/ScoreBoardAndToggle.test.tsx | 11 +++++++++++ 9 files changed, 72 insertions(+) create mode 100644 src/components/ActionButton.test.tsx create mode 100644 src/components/Avatar.test.tsx create mode 100644 src/components/CardImage.test.tsx create mode 100644 src/components/ChipImage.test.tsx create mode 100644 src/components/GithubProjectLink.test.tsx create mode 100644 src/components/MessageBar.test.tsx create mode 100644 src/components/Modal.test.tsx create mode 100644 src/components/PlayerAvatar.test.tsx create mode 100644 src/components/ScoreBoardAndToggle.test.tsx diff --git a/src/components/ActionButton.test.tsx b/src/components/ActionButton.test.tsx new file mode 100644 index 0000000..17eed6d --- /dev/null +++ b/src/components/ActionButton.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import ActionButton from "./ActionButton"; + +test('rendering does not crash', () => { + render(Text); +}); diff --git a/src/components/Avatar.test.tsx b/src/components/Avatar.test.tsx new file mode 100644 index 0000000..bf4df41 --- /dev/null +++ b/src/components/Avatar.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import Avatar from "./Avatar"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/CardImage.test.tsx b/src/components/CardImage.test.tsx new file mode 100644 index 0000000..0098a3b --- /dev/null +++ b/src/components/CardImage.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import CardImage from "./CardImage"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/ChipImage.test.tsx b/src/components/ChipImage.test.tsx new file mode 100644 index 0000000..d26e97a --- /dev/null +++ b/src/components/ChipImage.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import ChipImage from "./ChipImage"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/GithubProjectLink.test.tsx b/src/components/GithubProjectLink.test.tsx new file mode 100644 index 0000000..5e7bc19 --- /dev/null +++ b/src/components/GithubProjectLink.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import GithubProjectLink from "./GithubProjectLink"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/MessageBar.test.tsx b/src/components/MessageBar.test.tsx new file mode 100644 index 0000000..723e426 --- /dev/null +++ b/src/components/MessageBar.test.tsx @@ -0,0 +1,12 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import MessageBar from "./MessageBar"; + +test('rendering does not crash', () => { + render(()} + />); +}); diff --git a/src/components/Modal.test.tsx b/src/components/Modal.test.tsx new file mode 100644 index 0000000..a0cabe2 --- /dev/null +++ b/src/components/Modal.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import Modal from "./Modal"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/PlayerAvatar.test.tsx b/src/components/PlayerAvatar.test.tsx new file mode 100644 index 0000000..26c9014 --- /dev/null +++ b/src/components/PlayerAvatar.test.tsx @@ -0,0 +1,7 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import PlayerAvatar from "./PlayerAvatar"; + +test('rendering does not crash', () => { + render(); +}); diff --git a/src/components/ScoreBoardAndToggle.test.tsx b/src/components/ScoreBoardAndToggle.test.tsx new file mode 100644 index 0000000..d7db383 --- /dev/null +++ b/src/components/ScoreBoardAndToggle.test.tsx @@ -0,0 +1,11 @@ +import React from 'react'; +import { render } from '@testing-library/react'; +import ScoreBoardAndToggle from "./ScoreBoardAndToggle"; + +test('rendering does not crash', () => { + render(); +});