Skip to content

Commit

Permalink
test: move test files to component folder
Browse files Browse the repository at this point in the history
  • Loading branch information
dklemmt committed Oct 22, 2024
1 parent 5e0cd69 commit a8b9730
Show file tree
Hide file tree
Showing 18 changed files with 21 additions and 22 deletions.
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { AssistiveText, AssistiveTextProps } from "../AssistiveText";
import { AssistiveText, AssistiveTextProps } from "./AssistiveText";

describe("AssistiveText component", () => {
const defaultProps: AssistiveTextProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { BlockQuote, BlockQuoteProps } from "../BlockQuote";
import { BlockQuote, BlockQuoteProps } from "./BlockQuote";

describe("BlockQuote component", () => {
const defaultProps: BlockQuoteProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Checkbox, CheckboxProps } from "../Checkbox";
import { Checkbox, CheckboxProps } from "./Checkbox";

describe("Checkbox component", () => {
const defaultProps: CheckboxProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Code, CodeProps } from "../Code";
import { Code, CodeProps } from "./Code";

describe("Code component", () => {
const defaultProps: CodeProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Divider } from "../Divider";
import { Divider } from "./Divider";

describe("Divider component", () => {
it("renders divider without children", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { ErrorText, ErrorTextProps } from "../ErrorText";
import { ErrorText, ErrorTextProps } from "./ErrorText";

describe("ErrorText component", () => {
const defaultProps: ErrorTextProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Flex, FlexProps } from "../Flex";
import { Flex, FlexProps } from "./Flex";

describe("Flex component", () => {
const defaultProps: FlexProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Heading, HeadingProps } from "../Heading";
import { Heading, HeadingProps } from "./Heading";

describe("Heading component", () => {
const defaultProps: HeadingProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render, waitFor } from "@testing-library/react";
import { Image, ImageProps } from "../Image";
import { Image, ImageProps } from "./Image";

describe("Image component", () => {
const defaultProps: ImageProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { render } from "@testing-library/react";
import "@testing-library/jest-dom";
import { Input, InputProps } from "../Input";
import { Input, InputProps } from "./Input";

describe("Input component", () => {
const defaultProps: InputProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Link } from "../Link";
import { Link } from "./Link";

describe("Link component", () => {
it("renders link with children", () => {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
import type { ImageProps } from "@components/Image";
import type { VideoProps } from "@components/Video";
import "@testing-library/jest-dom";
import React from "react";
import { render, screen } from "@testing-library/react";
import { OffsetMedia, OffsetMediaProps } from "../OffsetMedia";
import type { ImageProps } from "@components/Image";
import type { VideoProps } from "@components/Video";
import { OffsetMedia, OffsetMediaProps } from "./OffsetMedia";

jest.mock("@components/Image", () => (props: ImageProps) => (
<img data-testid="offset-media-image" {...props} />
<img alt="" data-testid="offset-media-image" {...props} />
));
jest.mock("@components/Video", () => (props: VideoProps) => (
<video data-testid="offset-media-video" {...props} />
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Paragraph, ParagraphProps } from "../Paragraph";
import { Paragraph, ParagraphProps } from "./Paragraph";

describe("Paragraph component", () => {
const defaultProps: ParagraphProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Radio, RadioProps } from "../Radio";
import { Radio, RadioProps } from "./Radio";

describe("Radio component", () => {
const defaultProps: RadioProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { RadioGroup, RadioGroupProps } from "../RadioGroup";
import { RadioGroup, RadioGroupProps } from "./RadioGroup";

describe("RadioGroup component", () => {
const defaultProps: RadioGroupProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Spinner, SpinnerProps } from "../Spinner";
import { Spinner, SpinnerProps } from "./Spinner";

describe("Spinner component", () => {
const defaultProps: SpinnerProps = {};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { fireEvent, render } from "@testing-library/react";
import { Textarea, TextareaProps } from "../Textarea";
import { Textarea, TextareaProps } from "./Textarea";

describe("Textarea component", () => {
const defaultProps: TextareaProps = {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import "@testing-library/jest-dom";
import { render } from "@testing-library/react";
import { Video, VideoProps } from "../Video";
import { Video, VideoProps } from "./Video";

describe("Video component", () => {
const defaultProps: VideoProps = {
Expand Down

0 comments on commit a8b9730

Please sign in to comment.