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.
Merge branch 'trunk' of github.com:reactioncommerce/admin-core into t…
…runk
- Loading branch information
Showing
10 changed files
with
64 additions
and
18 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
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
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
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
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,9 @@ | ||
// Add async/await features | ||
// eslint-disable-next-line node/no-extraneous-require | ||
require("regenerator-runtime/runtime"); | ||
|
||
// add some helpful assertions | ||
require("@testing-library/jest-dom/extend-expect"); | ||
|
||
// Polyfill fetch | ||
require("unfetch/polyfill"); |
File renamed without changes.
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
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,47 @@ | ||
/* eslint-disable react/no-multi-comp */ | ||
/* eslint-disable react/display-name */ | ||
import React from "react"; | ||
import { registerRoute, registerSetting, routes, defaultRouteGroups } from "./routes"; | ||
|
||
beforeEach(() => { | ||
// Clear the routes array for each test | ||
routes.splice(0, routes.length); | ||
}); | ||
|
||
test("should register a route", () => { | ||
registerRoute({ | ||
navigationItemLabel: "Test", | ||
path: "/test", | ||
MainComponent: () => (<span>Test Component</span>) | ||
}); | ||
|
||
expect(routes.length).toEqual(1); | ||
expect(routes[0].navigationItemLabel).toEqual("Test"); | ||
expect(typeof routes[0].MainComponent).toEqual("function"); | ||
expect(routes[0]).toEqual({ | ||
priority: expect.any(Number), | ||
navigationItemLabel: "Test", | ||
path: "/test", | ||
MainComponent: expect.any(Function) | ||
}); | ||
}); | ||
|
||
test("should register a setting route", () => { | ||
registerSetting({ | ||
name: "test-setting", | ||
navigationItemLabel: "Test Setting", | ||
MainComponent: () => (<span>Test Component</span>) | ||
}); | ||
|
||
expect(routes.length).toEqual(1); | ||
|
||
expect(routes[0]).toEqual({ | ||
priority: expect.any(Number), | ||
name: "test-setting", | ||
group: defaultRouteGroups.settings, | ||
navigationItemLabel: "Test Setting", | ||
path: "/settings/test-setting", | ||
href: "/settings/test-setting", | ||
MainComponent: expect.any(Function) | ||
}); | ||
}); |
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
This file was deleted.
Oops, something went wrong.