@@ -8,6 +8,12 @@ import components from '../../../components/index.js';
88import CTx from '../../../utils/api/index.js' ;
99import Api from './api.js' ;
1010import { 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+ } ;
1117let container = document . createElement ( 'div' ) ;
1218const getButton = ( ctx ) =>
1319 memo (
@@ -29,7 +35,7 @@ beforeAll(() => {
2935} ) ;
3036let userProxy = { } ;
3137beforeEach ( ( ) => {
32- const ins = new CTx ( {
38+ const ins = getIns ( {
3339 options : { } ,
3440 } ) ;
3541 userProxy = ins . userProxy ;
@@ -45,7 +51,7 @@ afterAll(() => {
4551describe ( 'Enable Accesibility : ' , ( ) => {
4652 test ( 'DEFAULT:' , ( ) => {
4753 const Button = getButton (
48- new CTx ( {
54+ getIns ( {
4955 options : {
5056 moreButtonPlugin_iconComponent,
5157 } ,
@@ -62,7 +68,7 @@ describe('Enable Accesibility : ', () => {
6268 } ) ;
6369 test ( 'MULTIPLE BUTTON SHOULD NOT HAVE SAME ID:' , ( ) => {
6470 const Button = getButton (
65- new CTx ( {
71+ getIns ( {
6672 options : {
6773 moreButtonPlugin_iconComponent,
6874 } ,
@@ -82,7 +88,7 @@ describe('Enable Accesibility : ', () => {
8288describe ( 'DISABLE ACCESIBILITY : ' , ( ) => {
8389 test ( 'DEFAULT:' , ( ) => {
8490 const Button = getButton (
85- new CTx ( {
91+ getIns ( {
8692 options : {
8793 moreButtonPlugin_iconComponent,
8894 accessibility : false ,
@@ -102,7 +108,7 @@ describe('DISABLE ACCESIBILITY : ', () => {
102108describe ( 'OPEN AND CLOSE POPPER:' , ( ) => {
103109 test ( 'BUTTON CLICK:' , ( ) => {
104110 const Button = getButton (
105- new CTx ( {
111+ getIns ( {
106112 options : {
107113 moreButtonPlugin_iconComponent,
108114 //accessibility: false,
@@ -130,7 +136,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
130136 } ) ;
131137 test ( 'document click:' , ( ) => {
132138 const Button = getButton (
133- new CTx ( {
139+ getIns ( {
134140 options : {
135141 moreButtonPlugin_iconComponent,
136142 } ,
@@ -156,7 +162,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
156162 expect ( getBtn ( ) . getAttribute ( 'aria-expanded' ) == 'true' ) . toBe ( false ) ;
157163 } ) ;
158164 test ( 'select tab:' , ( ) => {
159- const ins = new CTx ( {
165+ const ins = getIns ( {
160166 options : {
161167 moreButtonPlugin_iconComponent,
162168 } ,
@@ -189,7 +195,7 @@ describe('OPEN AND CLOSE POPPER:', () => {
189195 ref . _cleanSelectEvent = jest . fn ( ( ) => { } ) ;
190196 return ref ;
191197 } ;
192- const ins = new CTx ( {
198+ const ins = getIns ( {
193199 options : {
194200 moreButtonPlugin_iconComponent,
195201 } ,
@@ -231,7 +237,7 @@ describe('TABS COMPONENT:', () => {
231237 buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
232238 return buttonApi ;
233239 } ;
234- const ins = new CTx ( {
240+ const ins = getIns ( {
235241 options : {
236242 moreButtonPlugin_iconComponent,
237243 selectedTabID : '1' ,
@@ -279,7 +285,7 @@ describe('TABS COMPONENT:', () => {
279285 buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
280286 return buttonApi ;
281287 } ;
282- const ins = new CTx ( {
288+ const ins = getIns ( {
283289 options : {
284290 moreButtonPlugin_iconComponent,
285291 selectedTabID : '1' ,
@@ -327,7 +333,7 @@ describe('TABS COMPONENT:', () => {
327333 buttonApi = ( Api . default || Api ) . call ( this , components , setOpen ) ;
328334 return buttonApi ;
329335 } ;
330- const ins = new CTx ( {
336+ const ins = getIns ( {
331337 options : {
332338 moreButtonPlugin_iconComponent,
333339 selectedTabID : '1' ,
0 commit comments