@@ -21,7 +21,7 @@ function createLinkWrapper(pathname: string) {
2121 return createElement (
2222 PathnameContext ,
2323 { value : pathname } ,
24- createElement ( MatcherContext , { value : matcher } , children ) ,
24+ createElement ( MatcherContext , { value : matcher } , children )
2525 )
2626 }
2727}
@@ -44,11 +44,7 @@ describe('Link', { concurrent: true }, function () {
4444 } )
4545
4646 act ( function ( ) {
47- root . render (
48- createElement ( Wrapper , null ,
49- createElement ( Link , { href : '/about' } , 'About' ) ,
50- ) ,
51- )
47+ root . render ( createElement ( Wrapper , null , createElement ( Link , { href : '/about' } , 'About' ) ) )
5248 } )
5349
5450 const anchor = container . querySelector ( 'a' )
@@ -75,9 +71,7 @@ describe('Link', { concurrent: true }, function () {
7571
7672 act ( function ( ) {
7773 root . render (
78- createElement ( Wrapper , null ,
79- createElement ( Link , { href : '/contact' } , 'Contact' ) ,
80- ) ,
74+ createElement ( Wrapper , null , createElement ( Link , { href : '/contact' } , 'Contact' ) )
8175 )
8276 } )
8377
@@ -86,7 +80,10 @@ describe('Link', { concurrent: true }, function () {
8680 expect ( anchor ?. getAttribute ( 'href' ) ) . toBe ( '/contact' )
8781 } )
8882
89- it ( 'adds data-active and aria-current when pathname matches href' , function ( { expect, onTestFinished } ) {
83+ it ( 'adds data-active and aria-current when pathname matches href' , function ( {
84+ expect,
85+ onTestFinished,
86+ } ) {
9087 const container = document . createElement ( 'div' )
9188
9289 document . body . appendChild ( container )
@@ -103,11 +100,7 @@ describe('Link', { concurrent: true }, function () {
103100 } )
104101
105102 act ( function ( ) {
106- root . render (
107- createElement ( Wrapper , null ,
108- createElement ( Link , { href : '/about' } , 'About' ) ,
109- ) ,
110- )
103+ root . render ( createElement ( Wrapper , null , createElement ( Link , { href : '/about' } , 'About' ) ) )
111104 } )
112105
113106 const anchor = container . querySelector ( 'a' )
@@ -116,7 +109,10 @@ describe('Link', { concurrent: true }, function () {
116109 expect ( anchor ?. getAttribute ( 'aria-current' ) ) . toBe ( 'page' )
117110 } )
118111
119- it ( 'does not add active attributes when pathname does not match' , function ( { expect, onTestFinished } ) {
112+ it ( 'does not add active attributes when pathname does not match' , function ( {
113+ expect,
114+ onTestFinished,
115+ } ) {
120116 const container = document . createElement ( 'div' )
121117
122118 document . body . appendChild ( container )
@@ -133,11 +129,7 @@ describe('Link', { concurrent: true }, function () {
133129 } )
134130
135131 act ( function ( ) {
136- root . render (
137- createElement ( Wrapper , null ,
138- createElement ( Link , { href : '/about' } , 'About' ) ,
139- ) ,
140- )
132+ root . render ( createElement ( Wrapper , null , createElement ( Link , { href : '/about' } , 'About' ) ) )
141133 } )
142134
143135 const anchor = container . querySelector ( 'a' )
@@ -164,9 +156,11 @@ describe('Link', { concurrent: true }, function () {
164156
165157 act ( function ( ) {
166158 root . render (
167- createElement ( Wrapper , null ,
168- createElement ( Link , { href : '/page' , className : 'nav-link' } , 'Page' ) ,
169- ) ,
159+ createElement (
160+ Wrapper ,
161+ null ,
162+ createElement ( Link , { href : '/page' , className : 'nav-link' } , 'Page' )
163+ )
170164 )
171165 } )
172166
@@ -193,14 +187,20 @@ describe('Link', { concurrent: true }, function () {
193187
194188 act ( function ( ) {
195189 root . render (
196- createElement ( Wrapper , null ,
197- createElement ( Link , {
198- href : '/active' ,
199- className : function ( { isActive } ) {
200- return isActive ? 'is-active' : 'not-active'
190+ createElement (
191+ Wrapper ,
192+ null ,
193+ createElement (
194+ Link ,
195+ {
196+ href : '/active' ,
197+ className : function ( { isActive } ) {
198+ return isActive ? 'is-active' : 'not-active'
199+ } ,
201200 } ,
202- } , 'Active Link' ) ,
203- ) ,
201+ 'Active Link'
202+ )
203+ )
204204 )
205205 } )
206206
@@ -227,13 +227,19 @@ describe('Link', { concurrent: true }, function () {
227227
228228 act ( function ( ) {
229229 root . render (
230- createElement ( Wrapper , null ,
231- createElement ( Link , {
232- href : '/test' ,
233- target : '_blank' ,
234- rel : 'noopener' ,
235- } , 'Test' ) ,
236- ) ,
230+ createElement (
231+ Wrapper ,
232+ null ,
233+ createElement (
234+ Link ,
235+ {
236+ href : '/test' ,
237+ target : '_blank' ,
238+ rel : 'noopener' ,
239+ } ,
240+ 'Test'
241+ )
242+ )
237243 )
238244 } )
239245
@@ -243,7 +249,10 @@ describe('Link', { concurrent: true }, function () {
243249 expect ( anchor ?. getAttribute ( 'rel' ) ) . toBe ( 'noopener' )
244250 } )
245251
246- it ( 'supports non-exact active matching with activeExact false' , function ( { expect, onTestFinished } ) {
252+ it ( 'supports non-exact active matching with activeExact false' , function ( {
253+ expect,
254+ onTestFinished,
255+ } ) {
247256 const container = document . createElement ( 'div' )
248257
249258 document . body . appendChild ( container )
@@ -261,12 +270,18 @@ describe('Link', { concurrent: true }, function () {
261270
262271 act ( function ( ) {
263272 root . render (
264- createElement ( Wrapper , null ,
265- createElement ( Link , {
266- href : '/docs' ,
267- activeExact : false ,
268- } , 'Docs' ) ,
269- ) ,
273+ createElement (
274+ Wrapper ,
275+ null ,
276+ createElement (
277+ Link ,
278+ {
279+ href : '/docs' ,
280+ activeExact : false ,
281+ } ,
282+ 'Docs'
283+ )
284+ )
270285 )
271286 } )
272287
@@ -293,11 +308,7 @@ describe('Link', { concurrent: true }, function () {
293308 } )
294309
295310 act ( function ( ) {
296- root . render (
297- createElement ( Wrapper , null ,
298- createElement ( Link , { href : '/page' } , 'Page' ) ,
299- ) ,
300- )
311+ root . render ( createElement ( Wrapper , null , createElement ( Link , { href : '/page' } , 'Page' ) ) )
301312 } )
302313
303314 const anchor = container . querySelector ( 'a' )
0 commit comments