Skip to content

Commit fb0c28d

Browse files
create defaultOptions.test.js
1 parent c9bd083 commit fb0c28d

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed
Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
import DefaultOptions from './defaultOptions.js';
2+
import DefaultTabInnerComponent from '../../../tab/defaulTabInner.js';
3+
describe('DefaultOptions.prototype.getOptions : ', () => {
4+
test('returned options should have a correct structure and format', () => {
5+
const expected = {
6+
tabs: [],
7+
selectedTabID: '',
8+
beforeSelect: expect.any(Function),
9+
beforeClose: expect.any(Function),
10+
onOpen: expect.any(Function),
11+
onClose: expect.any(Function),
12+
onSelect: expect.any(Function),
13+
onChange: expect.any(Function),
14+
onLoad: expect.any(Function),
15+
onDestroy: expect.any(Function),
16+
onInit: expect.any(Function),
17+
accessibility: true,
18+
defaultPanelComponent: expect.any(Function),
19+
direction: 'ltr',
20+
tabComponent: expect.any(Function)
21+
};
22+
const received = new (DefaultOptions)(DefaultTabInnerComponent).getOptions();;
23+
expect(received).toEqual(expected);
24+
});
25+
});

0 commit comments

Comments
 (0)