forked from microsoft/VoTT
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathApp.test.tsx
34 lines (30 loc) · 1.17 KB
/
App.test.tsx
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
import React from "react";
import App from "./App";
import { Provider } from "react-redux";
import createReduxStore from "./redux/store/store";
import initialState from "./redux/store/initialState";
import { IApplicationState } from "./models//applicationState";
import { mount } from "enzyme";
import { Router } from "react-router-dom";
import { KeyboardManager } from "./react/components/common/keyboardManager/keyboardManager";
import { ErrorHandler } from "./react/components/common/errorHandler/errorHandler";
describe("App Component", () => {
const defaultState: IApplicationState = initialState;
const store = createReduxStore(defaultState);
function createComponent() {
return mount(
<Provider store={store}>
<App />
</Provider>,
);
}
it("renders without crashing", () => {
createComponent();
});
it("renders required top level components", () => {
const wrapper = createComponent();
expect(wrapper.find(Router).exists()).toBe(true);
expect(wrapper.find(KeyboardManager).exists()).toEqual(true);
expect(wrapper.find(ErrorHandler).exists()).toEqual(true);
});
});