Skip to content

Commit f355497

Browse files
committed
Resizing tests
1 parent e588f69 commit f355497

File tree

1 file changed

+55
-5
lines changed

1 file changed

+55
-5
lines changed

test/default-split-pane-tests.js

Lines changed: 55 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ describe('Div panes', () => {
153153

154154
describe('Drag resizer', () => {
155155

156-
it('vertical panes', () => {
156+
it('vertical divs', () => {
157157
const jsx = (
158158
<SplitPane>
159159
<div>one</div>
@@ -162,12 +162,62 @@ describe('Div panes', () => {
162162
);
163163

164164
asserter(jsx)
165-
.assertOrientation('vertical')
166-
.assertNumberOfPanes(2)
167-
.assertNumberOfResizers(1)
165+
.assertRatios([50, 50])
166+
.assertSizes([299.5, 299.5])
167+
.dragResizer(0, {x: 20, y: 20})
168+
.assertSizes([319.47, 279.53])
169+
.assertRatios([53, 47])
170+
});
171+
172+
it('horizontal divs', () => {
173+
const jsx = (
174+
<SplitPane split="horizontal">
175+
<div>one</div>
176+
<div>two</div>
177+
</SplitPane>
178+
);
179+
180+
asserter(jsx)
181+
.assertRatios([50, 50])
182+
.assertSizes([299.5, 299.5])
183+
.dragResizer(0, {x: 0, y: 20})
184+
.assertSizes([319.47, 279.53])
185+
.assertRatios([53, 47])
186+
;
187+
});
188+
189+
it('vertical Panes', () => {
190+
const jsx = (
191+
<SplitPane>
192+
<Pane>one</Pane>
193+
<Pane>two</Pane>
194+
</SplitPane>
195+
);
196+
197+
asserter(jsx)
198+
.assertRatios([50, 50])
168199
.assertSizes([299.5, 299.5])
169200
.dragResizer(0, {x: 20, y: 0})
170-
.assertSizes([319.47, 279.53]);
201+
.assertSizes([319.47, 279.53])
202+
.assertRatios([53, 47])
203+
;
204+
});
205+
206+
it('horizontal Panes', () => {
207+
const jsx = (
208+
<SplitPane split="horizontal">
209+
<Pane>one</Pane>
210+
<Pane>two</Pane>
211+
</SplitPane>
212+
);
213+
214+
asserter(jsx)
215+
.assertRatios([50, 50])
216+
.assertSizes([299.5, 299.5])
217+
.dragResizer(0, {x: 0, y: 20})
218+
.assertSizes([319.47, 279.53])
219+
.assertRatios([53, 47])
220+
;
171221
});
172222
});
173223
});

0 commit comments

Comments
 (0)