This repository has been archived by the owner on Dec 14, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Mike Murray <hellomikemurray@gmail.com>
- Loading branch information
1 parent
7c86cf3
commit 0676bcb
Showing
2 changed files
with
98 additions
and
0 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import React from "react"; | ||
import { render } from "../test-utils"; | ||
import Dashboard from "./Dashboard"; | ||
|
||
jest.mock("../hooks/useAuth", () => ({ | ||
__esModule: true, | ||
default: () => ({ | ||
logout: jest.fn(), | ||
viewer: { | ||
primaryEmail: "test@reactioncommerce.com" | ||
} | ||
}) | ||
})); | ||
|
||
const mockPlugins = [ | ||
{ | ||
route: "/test-1", | ||
navTitle: "Test 1", | ||
// eslint-disable-next-line react/display-name | ||
MainComponent: () => (<span>Route Test 1</span>) | ||
} | ||
]; | ||
|
||
test("should be true", () => { | ||
const { asFragment } = render(( | ||
<Dashboard | ||
title="Test App" | ||
plugins={mockPlugins} | ||
/> | ||
)); | ||
expect(asFragment()).toMatchSnapshot(); | ||
}); |
66 changes: 66 additions & 0 deletions
66
package/src/Dashboard/__snapshots__/Dashboard.test.js.snap
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
// Jest Snapshot v1, https://goo.gl/fbAQLP | ||
|
||
exports[`should be true 1`] = ` | ||
<DocumentFragment> | ||
<div | ||
class="MuiContainer-root MuiContainer-maxWidthLg" | ||
> | ||
<div | ||
class="MuiDrawer-root MuiDrawer-docked" | ||
> | ||
<div | ||
class="MuiPaper-root MuiDrawer-paper MuiDrawer-paperAnchorLeft MuiDrawer-paperAnchorDockedLeft MuiPaper-elevation0" | ||
> | ||
<ul | ||
class="MuiList-root MuiList-padding" | ||
> | ||
<div | ||
aria-disabled="false" | ||
class="MuiButtonBase-root MuiListItem-root makeStyles-listItem-6 MuiListItem-gutters MuiListItem-button" | ||
role="button" | ||
tabindex="0" | ||
> | ||
<div | ||
class="MuiListItemText-root makeStyles-listItemText-7" | ||
> | ||
Test 1 | ||
</div> | ||
<span | ||
class="MuiTouchRipple-root" | ||
/> | ||
</div> | ||
<div | ||
aria-disabled="false" | ||
class="MuiButtonBase-root MuiListItem-root makeStyles-listItem-6 MuiListItem-gutters MuiListItem-button" | ||
role="button" | ||
tabindex="0" | ||
> | ||
<div | ||
class="MuiListItemText-root makeStyles-listItemText-7" | ||
> | ||
Sign Out | ||
</div> | ||
<span | ||
class="MuiTouchRipple-root" | ||
/> | ||
</div> | ||
</ul> | ||
</div> | ||
</div> | ||
<div | ||
style="padding-left: 320px;" | ||
> | ||
<h1 | ||
class="MuiTypography-root MuiTypography-h1" | ||
> | ||
Test App | ||
</h1> | ||
<h2 | ||
class="MuiTypography-root MuiTypography-h2" | ||
> | ||
Welcome | ||
</h2> | ||
</div> | ||
</div> | ||
</DocumentFragment> | ||
`; |