Skip to content

Commit f29ed4f

Browse files
committed
Test random order of components
1 parent 7eb770a commit f29ed4f

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

src/components/__tests__/Tabs-test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,23 @@ describe('<Tabs />', () => {
280280
expect(result instanceof Error).toBe(true);
281281
});
282282

283+
it('should allow random order for elements', () => {
284+
const wrapper = mount(
285+
<Tabs>
286+
<TabPanel>Hello Foo</TabPanel>
287+
<TabList>
288+
<Tab>Foo</Tab>
289+
<Tab>Bar</Tab>
290+
</TabList>
291+
<TabPanel>Hello Bar</TabPanel>
292+
</Tabs>,
293+
);
294+
295+
296+
expect(wrapper.childAt(0).text()).toBe('Hello Foo');
297+
expect(wrapper.childAt(2).text()).toBe('Hello Bar');
298+
});
299+
283300
it('should not throw a warning when wrong element is found', () => {
284301
const wrapper = shallow(
285302
<Tabs>

0 commit comments

Comments
 (0)