Skip to content

Commit d3aac60

Browse files
committed
add test case
1 parent bdb3a83 commit d3aac60

File tree

1 file changed

+36
-0
lines changed

1 file changed

+36
-0
lines changed

tests/jumper.test.js

Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,4 +110,40 @@ describe('simple quick jumper', () => {
110110
expect(onChange).toHaveBeenLastCalledWith(2, 10);
111111
});
112112
});
113+
114+
it('goButton could be true', () => {
115+
wrapper = mount(
116+
<Pagination
117+
onChange={onChange}
118+
defaultCurrent={10}
119+
total={1000}
120+
showQuickJumper={{ goButton: true }}
121+
/>,
122+
);
123+
expect(wrapper.find('button').exists()).toBe(true);
124+
});
125+
126+
it('goButton defaultly hidden', () => {
127+
wrapper = mount(
128+
<Pagination
129+
onChange={onChange}
130+
defaultCurrent={10}
131+
total={1000}
132+
showQuickJumper
133+
/>,
134+
);
135+
expect(wrapper.find('button').exists()).toBe(false);
136+
});
137+
138+
it('goButton could be false', () => {
139+
wrapper = mount(
140+
<Pagination
141+
onChange={onChange}
142+
defaultCurrent={10}
143+
total={1000}
144+
showQuickJumper={{ goButton: false }}
145+
/>,
146+
);
147+
expect(wrapper.find('button').exists()).toBe(false);
148+
});
113149
});

0 commit comments

Comments
 (0)