Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 28 additions & 1 deletion src/atoms/typography/paragraph.test.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,32 @@
import React from "react";
import { render } from "@testing-library/react";
import faker from "faker";
import { Paragraph } from "./paragraph";

describe("Paragraph", () => {
test.skip("TODO - https://github.com/AndcultureCode/AndcultureCode.JavaScript.React.Components/issues/15", () => {});
test("when default props, renders paragraph with text", () => {
// Act
const expected = faker.random.words();

// Arrange
const { getByText } = render(<Paragraph>{expected}</Paragraph>);

// Assert
expect(getByText(expected)).not.toBeNil();
});

test("when given cssClassName prop, renders paragraph with given class name", () => {
// Act
const expected = faker.random.words();
const testClassName = "testClassName";

// Arrange
const { container } = render(
<Paragraph cssClassName={testClassName}>{expected}</Paragraph>
);
const result = container.querySelector("." + testClassName);

// Assert
expect(result).not.toBeNil();
});
});