Skip to content

Commit 4107ad4

Browse files
committed
Resizing tests - multiple panes
1 parent f355497 commit 4107ad4

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed

test/default-split-pane-tests.js

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -219,5 +219,69 @@ describe('Div panes', () => {
219219
.assertRatios([53, 47])
220220
;
221221
});
222+
223+
describe('multiple horizontal Panes', () => {
224+
225+
it('first resizer', () => {
226+
227+
const jsx = (
228+
<SplitPane split="horizontal">
229+
<Pane>one</Pane>
230+
<Pane>two</Pane>
231+
<Pane>three</Pane>
232+
<Pane>four</Pane>
233+
</SplitPane>
234+
);
235+
236+
asserter(jsx)
237+
.assertRatios([25, 25, 25, 25])
238+
.assertSizes([149.25, 149.25, 149.25, 149.25])
239+
.dragResizer(0, {x: 0, y: 20})
240+
.assertRatios([28, 22, 25, 25])
241+
.assertSizes([169.47, 129.53, 149, 149])
242+
;
243+
});
244+
245+
it('second resizer', () => {
246+
247+
const jsx = (
248+
<SplitPane split="horizontal">
249+
<Pane>one</Pane>
250+
<Pane>two</Pane>
251+
<Pane>three</Pane>
252+
<Pane>four</Pane>
253+
</SplitPane>
254+
);
255+
256+
asserter(jsx)
257+
.assertRatios([25, 25, 25, 25])
258+
.assertSizes([149.25, 149.25, 149.25, 149.25])
259+
.dragResizer(1, {x: 0, y: 20})
260+
.assertRatios([25, 28, 22, 25])
261+
.assertSizes([149, 169.47, 129.53, 149])
262+
;
263+
});
264+
265+
it('third resizer', () => {
266+
267+
const jsx = (
268+
<SplitPane split="horizontal">
269+
<Pane>one</Pane>
270+
<Pane>two</Pane>
271+
<Pane>three</Pane>
272+
<Pane>four</Pane>
273+
</SplitPane>
274+
);
275+
276+
asserter(jsx)
277+
.assertRatios([25, 25, 25, 25])
278+
.assertSizes([149.25, 149.25, 149.25, 149.25])
279+
.dragResizer(2, {x: 0, y: 20})
280+
.assertRatios([25, 25, 28, 22])
281+
.assertSizes([149, 149, 169.47, 129.53])
282+
;
283+
});
284+
});
285+
222286
});
223287
});

0 commit comments

Comments
 (0)