Skip to content

Commit 8b18027

Browse files
write a test for isVertical option
1 parent 84a9136 commit 8b18027

File tree

2 files changed

+77
-0
lines changed

2 files changed

+77
-0
lines changed

src/tabList/__snapshots__/tabList.test.js.snap

+66
Original file line numberDiff line numberDiff line change
@@ -66,6 +66,72 @@ exports[`TabList structure : default options 1`] = `
6666
</div>
6767
`;
6868

69+
exports[`TabList structure : isVertical option 1`] = `
70+
<div>
71+
<ul
72+
className="rc-dyn-tabs-tablist rc-dyn-tabs-ltr rc-dyn-tabs-vertical"
73+
role="tablist"
74+
>
75+
<li
76+
aria-controls="rc-dyn-tabs-p-1"
77+
aria-expanded={true}
78+
aria-labelledby="rc-dyn-tabs-l-1"
79+
aria-selected={true}
80+
className="rc-dyn-tabs-tab rc-dyn-tabs-selected"
81+
onClick={[Function]}
82+
role="tab"
83+
tab-id="1"
84+
tabIndex={0}
85+
>
86+
<button
87+
className="rc-dyn-tabs-title"
88+
id="rc-dyn-tabs-l-1"
89+
role="presentation"
90+
tab-id="1"
91+
tabIndex={-1}
92+
title=""
93+
>
94+
tab1
95+
</button>
96+
<span
97+
className="rc-dyn-tabs-close"
98+
role="presentation"
99+
>
100+
×
101+
</span>
102+
</li>
103+
<li
104+
aria-controls="rc-dyn-tabs-p-2"
105+
aria-expanded={false}
106+
aria-labelledby="rc-dyn-tabs-l-2"
107+
aria-selected={false}
108+
className="rc-dyn-tabs-tab"
109+
onClick={[Function]}
110+
role="tab"
111+
tab-id="2"
112+
tabIndex={-1}
113+
>
114+
<button
115+
className="rc-dyn-tabs-title"
116+
id="rc-dyn-tabs-l-2"
117+
role="presentation"
118+
tab-id="2"
119+
tabIndex={-1}
120+
title=""
121+
>
122+
tab2
123+
</button>
124+
<span
125+
className="rc-dyn-tabs-close"
126+
role="presentation"
127+
>
128+
×
129+
</span>
130+
</li>
131+
</ul>
132+
</div>
133+
`;
134+
69135
exports[`TabList structure : none accessibility option 1`] = `
70136
<div>
71137
<ul

src/tabList/tabList.test.js

+11
Original file line numberDiff line numberDiff line change
@@ -67,4 +67,15 @@ describe('TabList structure : ', () => {
6767
.toJSON();
6868
expect(tree).toMatchSnapshot();
6969
});
70+
test('isVertical option', () => {
71+
setMockUseContext({isVertical: true});
72+
const tree = renderer
73+
.create(
74+
<div>
75+
<TabList></TabList>
76+
</div>,
77+
)
78+
.toJSON();
79+
expect(tree).toMatchSnapshot();
80+
});
7081
});

0 commit comments

Comments
 (0)