File tree Expand file tree Collapse file tree 1 file changed +6
-25
lines changed
packages/kit-headless/src/components/tabs Expand file tree Collapse file tree 1 file changed +6
-25
lines changed Original file line number Diff line number Diff line change @@ -13,8 +13,7 @@ interface DynamicTabsProps {
13
13
14
14
const ThreeTabsComponent = component$ ( ( ) => {
15
15
return (
16
-
17
- < Tabs data-testid = 'tabs' >
16
+ < Tabs data-testid = "tabs" >
18
17
< TabList >
19
18
< Tab > Tab 1</ Tab >
20
19
< Tab > Tab 2</ Tab >
@@ -25,8 +24,7 @@ const ThreeTabsComponent = component$(() => {
25
24
< TabPanel > Panel 2</ TabPanel >
26
25
< TabPanel > Panel 3</ TabPanel >
27
26
</ Tabs >
28
-
29
- )
27
+ ) ;
30
28
} ) ;
31
29
32
30
const DynamicTabsComponent = component$ (
@@ -68,35 +66,18 @@ const DynamicTabsComponent = component$(
68
66
) ;
69
67
70
68
describe ( 'Tabs' , ( ) => {
71
- it ( 'should render the component and check if its accessible' , ( ) => {
72
- cy . mount (
73
- < Tabs >
74
- < TabList >
75
- < Tab > Tab 1</ Tab >
76
- < Tab > Tab 2</ Tab >
77
- < Tab > Tab 3</ Tab >
78
- </ TabList >
79
-
80
- describe('Tabs', () => {
81
-
82
69
it ( 'INIT' , ( ) => {
83
- cy . mount (
84
- < ThreeTabsComponent />
85
- ) ;
70
+ cy . mount ( < ThreeTabsComponent /> ) ;
86
71
cy . findByTestId ( 'tabs' ) . matchImage ( ) ;
87
-
72
+
88
73
cy . checkA11yForComponent ( ) ;
89
- } )
74
+ } ) ;
90
75
it ( 'should render the component' , ( ) => {
91
- cy . mount (
92
- < ThreeTabsComponent />
93
- ) ;
76
+ cy . mount ( < ThreeTabsComponent /> ) ;
94
77
95
78
cy . findByRole ( 'tab' , { name : / T a b 2 / i } ) . click ( ) ;
96
79
97
80
cy . findByRole ( 'tabpanel' ) . should ( 'contain' , 'Panel 2' ) ;
98
-
99
-
100
81
} ) ;
101
82
102
83
it ( 'Given 3 tabs, when removing the last one dynamically, only 2 should remain' , ( ) => {
You can’t perform that action at this time.
0 commit comments