@@ -8,6 +8,12 @@ import components from '../../../components/index.js';
8
8
import CTx from '../../../utils/api/index.js' ;
9
9
import Api from './api.js' ;
10
10
import { ApiContext , StateContext } from '../../../context.js' ;
11
+ import { setSetting } from '../setComponents.js' ;
12
+ const getIns = ( op ) => {
13
+ const ins = new CTx ( op ) ;
14
+ setSetting ( ins ) ;
15
+ return ins ;
16
+ } ;
11
17
let container = document . createElement ( 'div' ) ;
12
18
const getButton = ( ctx ) =>
13
19
memo (
@@ -29,7 +35,7 @@ beforeAll(() => {
29
35
} ) ;
30
36
let userProxy = { } ;
31
37
beforeEach ( ( ) => {
32
- const ins = new CTx ( {
38
+ const ins = getIns ( {
33
39
options : { } ,
34
40
} ) ;
35
41
userProxy = ins . userProxy ;
@@ -45,7 +51,7 @@ afterAll(() => {
45
51
describe ( 'Enable Accesibility : ' , ( ) => {
46
52
test ( 'DEFAULT:' , ( ) => {
47
53
const Button = getButton (
48
- new CTx ( {
54
+ getIns ( {
49
55
options : {
50
56
moreButtonPlugin_iconComponent,
51
57
} ,
@@ -62,7 +68,7 @@ describe('Enable Accesibility : ', () => {
62
68
} ) ;
63
69
test ( 'MULTIPLE BUTTON SHOULD NOT HAVE SAME ID:' , ( ) => {
64
70
const Button = getButton (
65
- new CTx ( {
71
+ getIns ( {
66
72
options : {
67
73
moreButtonPlugin_iconComponent,
68
74
} ,
@@ -82,7 +88,7 @@ describe('Enable Accesibility : ', () => {
82
88
describe ( 'DISABLE ACCESIBILITY : ' , ( ) => {
83
89
test ( 'DEFAULT:' , ( ) => {
84
90
const Button = getButton (
85
- new CTx ( {
91
+ getIns ( {
86
92
options : {
87
93
moreButtonPlugin_iconComponent,
88
94
accessibility : false ,
@@ -102,7 +108,7 @@ describe('DISABLE ACCESIBILITY : ', () => {
102
108
describe ( 'OPEN AND CLOSE POPPER:' , ( ) => {
103
109
test ( 'BUTTON CLICK:' , ( ) => {
104
110
const Button = getButton (
105
- new CTx ( {
111
+ getIns ( {
106
112
options : {
107
113
moreButtonPlugin_iconComponent,
108
114
//accessibility: false,
@@ -130,7 +136,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
130
136
} ) ;
131
137
test ( 'document click:' , ( ) => {
132
138
const Button = getButton (
133
- new CTx ( {
139
+ getIns ( {
134
140
options : {
135
141
moreButtonPlugin_iconComponent,
136
142
} ,
@@ -156,7 +162,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
156
162
expect ( getBtn ( ) . getAttribute ( 'aria-expanded' ) == 'true' ) . toBe ( false ) ;
157
163
} ) ;
158
164
test ( 'select tab:' , ( ) => {
159
- const ins = new CTx ( {
165
+ const ins = getIns ( {
160
166
options : {
161
167
moreButtonPlugin_iconComponent,
162
168
} ,
@@ -189,7 +195,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
189
195
ref . _cleanSelectEvent = jest . fn ( ( ) => { } ) ;
190
196
return ref ;
191
197
} ;
192
- const ins = new CTx ( {
198
+ const ins = getIns ( {
193
199
options : {
194
200
moreButtonPlugin_iconComponent,
195
201
} ,
@@ -231,7 +237,7 @@ describe('TABS COMPONENT:', () => {
231
237
buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
232
238
return buttonApi ;
233
239
} ;
234
- const ins = new CTx ( {
240
+ const ins = getIns ( {
235
241
options : {
236
242
moreButtonPlugin_iconComponent,
237
243
selectedTabID : '1' ,
@@ -279,7 +285,7 @@ describe('TABS COMPONENT:', () => {
279
285
buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
280
286
return buttonApi ;
281
287
} ;
282
- const ins = new CTx ( {
288
+ const ins = getIns ( {
283
289
options : {
284
290
moreButtonPlugin_iconComponent,
285
291
selectedTabID : '1' ,
@@ -327,7 +333,7 @@ describe('TABS COMPONENT:', () => {
327
333
buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
328
334
return buttonApi ;
329
335
} ;
330
- const ins = new CTx ( {
336
+ const ins = getIns ( {
331
337
options : {
332
338
moreButtonPlugin_iconComponent,
333
339
selectedTabID : '1' ,
0 commit comments