react-openfin-mat-impl
Version:
Materialize UI implementation of react-openfin
51 lines • 2.05 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
const React = require("react");
const react_openfin_1 = require("react-openfin");
const IconButton_1 = require("@material-ui/core/IconButton");
const styles_1 = require("@material-ui/core/styles");
const styles_2 = require("@material-ui/styles");
const test_utils_1 = require("@material-ui/core/test-utils");
const react_router_dom_1 = require("react-router-dom");
const Notification_1 = require("./Notification");
const muiTheme = styles_1.createMuiTheme({});
const SampleNotification = ({}) => {
return (React.createElement(React.Fragment, null, "dummy sample notification"));
};
const notificationRoutes = [
{
path: '/notification/sample',
component: SampleNotification,
}
];
describe('Notification layout', () => {
let shallow;
let mount;
beforeAll(() => {
react_openfin_1.InitializeReactOpenfin({
finUuid: process.env.REACT_APP_FIN_UUID,
finMockupForceSilentMode: true,
i18n: {},
hist: {},
configTabs: [],
launchBarItems: [],
});
mount = test_utils_1.createMount();
});
afterAll(() => {
mount.cleanUp();
});
beforeEach(() => {
shallow = test_utils_1.createShallow();
});
it('render in default state correctly', () => {
const wrapper = mount(React.createElement(react_openfin_1.ReactOpenfin, null,
React.createElement(styles_2.ThemeProvider, { theme: muiTheme },
React.createElement(react_router_dom_1.MemoryRouter, { initialEntries: ['/notification'] },
React.createElement(Notification_1.default, { routes: notificationRoutes, location: { pathname: '/notification' } })))));
expect(wrapper.find(Notification_1.default)).toHaveLength(1);
expect(wrapper.find(IconButton_1.default)).toHaveLength(1);
wrapper.find(IconButton_1.default).props().onClick();
});
});
//# sourceMappingURL=Notification.spec.js.map