Created
August 16, 2018 03:45
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { h } from "preact"; | |
import { render, cleanup } from "preact-testing-library"; | |
import Main from "../src/example/index"; | |
import chrome from "sinon-chrome"; | |
window.chrome = chrome; | |
test("should render Main component", () => { | |
const getUrl = function() { | |
return chrome.runtime.getURL("popup-content.html"); | |
}; | |
chrome.runtime.getURL.returns("http://localhost:1234/index.html"); | |
const { container } = render(<Main getUrl={getUrl} />); | |
expect(container).toMatchSnapshot(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment