From 63a78c8ced70212d8517e7054f53ab6b681566b3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E4=BA=8C=E8=B4=A7=E6=9C=BA=E5=99=A8=E4=BA=BA?= Date: Wed, 3 Aug 2022 18:58:52 +0800 Subject: [PATCH] test: coverage --- tests/index.test.tsx | 26 ++++++++++++++++++++++++++ 1 file changed, 26 insertions(+) diff --git a/tests/index.test.tsx b/tests/index.test.tsx index f37ff1b6..042bfcc0 100644 --- a/tests/index.test.tsx +++ b/tests/index.test.tsx @@ -37,6 +37,32 @@ describe('Tabs.Basic', () => { expect(wrapper.render()).toMatchSnapshot(); }); + it('disabled not change', () => { + const onChange = jest.fn(); + + const wrapper = mount( + getTabs({ + defaultActiveKey: 'light', + items: [ + { + label: 'light', + key: 'light', + children: 'Light', + }, + { + label: 'disabled', + key: 'disabled', + children: 'Disabled', + disabled: true, + }, + ], + }), + ); + + wrapper.find('.rc-tabs-tab-disabled').simulate('click'); + expect(onChange).not.toHaveBeenCalled(); + }); + it('Skip invalidate children', () => { const wrapper = mount( getTabs({