custom post header

This commit is contained in:
2022-09-10 11:25:05 +02:00
parent 5277f19ca6
commit 109e47353f
10 changed files with 212 additions and 42 deletions

View File

@@ -1,10 +1,17 @@
import { Content } from "@/components/Post/Content";
import * as mocks from "@/mocks";
import { StaticQuery, useStaticQuery } from "gatsby";
import React from "react";
import renderer from "react-test-renderer";
import { Content } from "@/components/Post/Content";
import * as mocks from "@/mocks";
const mockedStaticQuery = StaticQuery as jest.Mock;
const mockedUseStaticQuery = useStaticQuery as jest.Mock;
describe("Content", () => {
beforeEach(() => {
mockedStaticQuery.mockImplementationOnce(({ render }) => render(mocks.siteMetadata));
mockedUseStaticQuery.mockReturnValue(mocks.siteMetadata);
});
it("renders correctly", () => {
const props = {
title: mocks.markdownRemark.frontmatter.title,