Skip to content

Commit ac7293a

Browse files
fix issue of index.test.js
1 parent 6d40330 commit ac7293a

File tree

1 file changed

+8
-7
lines changed

1 file changed

+8
-7
lines changed

src/index.test.js

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,8 @@ beforeEach(() => {
5858
</div>
5959
);
6060
};
61-
renderApp = (options = {}) => {
61+
renderApp = (options) => {
62+
options = options || {};
6263
act(() => {
6364
render(<App options={options}></App>, container);
6465
});
@@ -444,13 +445,13 @@ describe('sort method : ', () => {
444445
expect.assertions(4);
445446
renderApp();
446447
return act(() => {
447-
const buttons = document.querySelectorAll('button.rc-dyn-tabs-title');
448-
expect(buttons[0].id).toBe('rc-dyn-tabs-l-1');
449-
expect(buttons[1].id).toBe('rc-dyn-tabs-l-2');
448+
const lis = document.querySelectorAll('li.rc-dyn-tabs-tab');
449+
expect(lis[0].id).toBe('rc-dyn-tabs-l-1');
450+
expect(lis[1].id).toBe('rc-dyn-tabs-l-2');
450451
return instance.sort(['2', '1']).then(() => {
451-
const buttons = document.querySelectorAll('button.rc-dyn-tabs-title');
452-
expect(buttons[0].id).toBe('rc-dyn-tabs-l-2');
453-
expect(buttons[1].id).toBe('rc-dyn-tabs-l-1');
452+
const lis = document.querySelectorAll('li.rc-dyn-tabs-tab');
453+
expect(lis[0].id).toBe('rc-dyn-tabs-l-2');
454+
expect(lis[1].id).toBe('rc-dyn-tabs-l-1');
454455
});
455456
});
456457
});

0 commit comments

Comments
 (0)