-
Notifications
You must be signed in to change notification settings - Fork 4
/
CustomListPage-test.tsx
40 lines (34 loc) · 1.09 KB
/
CustomListPage-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
35
36
37
38
39
40
import { expect } from "chai";
import { stub } from "sinon";
import * as React from "react";
import { shallow } from "enzyme";
import buildStore from "../../store";
import CustomListPage from "../CustomListPage";
import CustomLists from "../CustomLists";
describe("CustomListPage", () => {
let wrapper;
let store;
let context;
beforeEach(() => {
store = buildStore();
context = {
editorStore: store,
csrfToken: "token",
};
const params = {
library: "library",
editOrCreate: "edit",
identifier: "identifier",
};
wrapper = shallow(<CustomListPage params={params} />, { context });
});
it("shows custom lists with info from params", () => {
const customLists = wrapper.find(CustomLists);
expect(customLists).to.be.ok;
expect(customLists.props().library).to.equal("library");
expect(customLists.props().editOrCreate).to.equal("edit");
expect(customLists.props().identifier).to.equal("identifier");
expect(customLists.props().store).to.equal(store);
expect(customLists.props().csrfToken).to.equal("token");
});
});