Skip to content

Commit

Permalink
test(frontend):Updated cookie exist test
Browse files Browse the repository at this point in the history
  • Loading branch information
nkrmr committed Oct 29, 2019
1 parent 794dfc2 commit 159807e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
import React from "react";
import { render } from "@testing-library/react";
import cookie from "js-cookie";
import CookieConsent from "../CookieConsent";

describe("<CookieConsent />", () => {
it("should render", () => {
const { container } = render(<CookieConsent />);
expect(container).toMatchSnapshot();
});
it("should not render if cookie exist", () => {
cookie.get = jest.fn().mockImplementation(() => true);
const { container } = render(<CookieConsent />);
expect(container).toMatchSnapshot();
});
});
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`<CookieConsent /> should not render if cookie exist 1`] = `<div />`;

exports[`<CookieConsent /> should render 1`] = `
.c6 {
display: inline-block;
Expand Down

0 comments on commit 159807e

Please sign in to comment.