Skip to content

Commit

Permalink
test: replacing toMatchInlineSnapshot within component/ui/__tests__/*…
Browse files Browse the repository at this point in the history
… files
  • Loading branch information
adibfirman committed Aug 14, 2021
1 parent f9ef60c commit 7e51141
Showing 1 changed file with 4 additions and 20 deletions.
24 changes: 4 additions & 20 deletions components/ui/__tests__/button.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -85,18 +85,9 @@ describe("Button", () => {

describe("SecondaryButton", () => {
it("renders correctly", () => {
const { container } = render(
<SecondaryButton>test button</SecondaryButton>,
);
render(<SecondaryButton>test button</SecondaryButton>);

expect(container.firstChild).toMatchInlineSnapshot(`
<button
class="inline-flex flex-row px-4 py-2 text-sm rounded-md items-center justify-center border border-transparent font-medium focus:outline-none focus:ring-2 focus:ring-offset-2 text-blue-700 bg-blue-100 hover:bg-blue-200 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-75"
type="button"
>
test button
</button>
`);
expect(screen.getByText("test button")).toBeInTheDocument();
});

it("renders with correct colors", () => {
Expand Down Expand Up @@ -161,16 +152,9 @@ describe("Button", () => {

describe("OutlineButton", () => {
it("renders correctly", () => {
const { container } = render(<OutlineButton>test button</OutlineButton>);
render(<OutlineButton>test button</OutlineButton>);

expect(container.firstChild).toMatchInlineSnapshot(`
<button
class="inline-flex flex-row px-4 py-2 text-sm rounded-md items-center justify-center border border-transparent font-medium shadow-sm focus:outline-none focus:ring-2 focus:ring-offset-2 text-blue-500 border-blue-500 hover:bg-blue-100 focus:ring-blue-500 disabled:cursor-not-allowed disabled:opacity-75"
type="button"
>
test button
</button>
`);
expect(screen.getByText("test button")).toBeInTheDocument();
});

it("renders with correct colors", () => {
Expand Down

0 comments on commit 7e51141

Please sign in to comment.