@@ -2,7 +2,7 @@ import React from 'react';
2
2
import { cleanup , fireEvent , render , waitFor } from '@testing-library/react' ;
3
3
import renderer from 'react-test-renderer' ;
4
4
import '@testing-library/jest-dom' ;
5
- import { Tabs , tabsClassName , tabsContentActiveClassName } from '..' ;
5
+ import { Tabs , tabsClassName } from '..' ;
6
6
import { ITabProps , tabItemActiveClassName } from '../tab' ;
7
7
import { dragToTargetNode } from '@test/utils' ;
8
8
@@ -32,10 +32,8 @@ describe('The Tabs Components', () => {
32
32
33
33
test ( 'Should render nothing' , ( ) => {
34
34
const { container } = render ( < Tabs /> ) ;
35
- const content = container . querySelector ( '.mo-tabs__content' ) ;
36
35
const header = container . querySelector ( '.mo-tabs__header' ) ;
37
36
38
- expect ( content ?. childElementCount ) . toBe ( 0 ) ;
39
37
expect ( header ?. childElementCount ) . toBe ( 0 ) ;
40
38
} ) ;
41
39
@@ -49,18 +47,6 @@ describe('The Tabs Components', () => {
49
47
expect ( body . classList ) . toContain ( 'test-tabs' ) ;
50
48
} ) ;
51
49
52
- test ( 'Should support to renderPane via function' , ( ) => {
53
- const data = mockData . concat ( ) ;
54
- data . push ( {
55
- id : '3' ,
56
- name : 'test-title-3' ,
57
- renderPane : ( ) => < div data-testid = "test3" > test3</ div > ,
58
- closable : true ,
59
- } ) ;
60
- const { getByTestId } = render ( < Tabs data = { data } /> ) ;
61
- expect ( getByTestId ( 'test3' ) ) . toBeInTheDocument ( ) ;
62
- } ) ;
63
-
64
50
test ( 'Should render card type' , ( ) => {
65
51
const { container } = render ( < Tabs type = "card" data = { mockData } /> ) ;
66
52
@@ -69,13 +55,9 @@ describe('The Tabs Components', () => {
69
55
} ) ;
70
56
71
57
test ( 'Should active specific tab' , ( ) => {
72
- const { getByText, getByTestId } = render (
73
- < Tabs activeTab = "1" data = { mockData } />
74
- ) ;
58
+ const { getByText } = render ( < Tabs activeTab = "1" data = { mockData } /> ) ;
75
59
const testHeader = getByText ( 'test-title-1' ) ;
76
- const testContent = getByTestId ( 'test1' ) . parentElement ;
77
60
expect ( testHeader ?. classList ) . toContain ( tabItemActiveClassName ) ;
78
- expect ( testContent ?. classList ) . toContain ( tabsContentActiveClassName ) ;
79
61
} ) ;
80
62
81
63
test ( 'Should trigger events' , async ( ) => {
0 commit comments