Skip to content

Commit 9f2eb27

Browse files
committed
fix: test disableTransitionProps
1 parent d6e6d7e commit 9f2eb27

File tree

1 file changed

+32
-0
lines changed

1 file changed

+32
-0
lines changed

src/Methods/Methods.test.tsx

Lines changed: 32 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,38 @@ it("renders schema methods name", () => {
4444
ReactDOM.unmountComponentAtNode(div);
4545
});
4646

47+
it("doesnt renders collapsed contents", () => {
48+
const div = document.createElement("div");
49+
const schema = {
50+
methods: [
51+
{
52+
params: [{
53+
name: "foobarz",
54+
}],
55+
},
56+
],
57+
};
58+
ReactDOM.render(<Methods schema={schema as any} />, div);
59+
expect(div.innerHTML.includes("foobarz")).toBe(false);
60+
ReactDOM.unmountComponentAtNode(div);
61+
});
62+
63+
it("renders collapsed contents with disableTransitionProps", () => {
64+
const div = document.createElement("div");
65+
const schema = {
66+
methods: [
67+
{
68+
params: [{
69+
name: "foobarz",
70+
}],
71+
},
72+
],
73+
};
74+
ReactDOM.render(<Methods schema={schema as any} disableTransitionProps={true}/>, div);
75+
expect(div.innerHTML.includes("foobarz")).toBe(true);
76+
ReactDOM.unmountComponentAtNode(div);
77+
});
78+
4779
it("renders schema plugin", () => {
4880
const div = document.createElement("div");
4981
const schema = {

0 commit comments

Comments
 (0)