Skip to content

Commit 031de96

Browse files
fix(tab): fixed tab component tests (#1599)
Co-authored-by: Alexey Yalovski <[email protected]>
1 parent c988d03 commit 031de96

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

Diff for: src/components/ui/tab/tab.spec.tsx

+11-2
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,7 @@ import {
3434
TabViewProps,
3535
} from './tabView.component';
3636
import { TabIndicator } from '../shared/tabIndicator.component';
37+
import {ReactTestInstance} from 'react-test-renderer';
3738

3839
describe('@tab: component checks', () => {
3940

@@ -160,7 +161,11 @@ describe('@tab-bar: component checks', () => {
160161
<TestTabBar indicatorStyle={{width: 99, backgroundColor: 'red'}}/>,
161162
);
162163

163-
const el = component.queryByType(TabIndicator).children[0].children[0].children[0].children[0];
164+
const el = ((
165+
(component.UNSAFE_queryByType(TabIndicator).children[0] as ReactTestInstance)
166+
.children[0] as ReactTestInstance)
167+
.children[0] as ReactTestInstance)
168+
.children[0] as ReactTestInstance;
164169

165170
// default styles
166171
expect(el.props.style[0].width).toEqual('100%');
@@ -220,7 +225,11 @@ describe('@tab-view: component checks', () => {
220225
<TestTabView indicatorStyle={{width: 99, backgroundColor: 'red'}}/>,
221226
);
222227

223-
const el = component.queryByType(TabIndicator).children[0].children[0].children[0].children[0];
228+
const el = ((
229+
(component.UNSAFE_queryByType(TabIndicator).children[0] as ReactTestInstance)
230+
.children[0] as ReactTestInstance)
231+
.children[0] as ReactTestInstance)
232+
.children[0] as ReactTestInstance;
224233

225234
// default styles
226235
expect(el.props.style[0].width).toEqual('100%');

0 commit comments

Comments
 (0)