File tree Expand file tree Collapse file tree 1 file changed +18
-1
lines changed
packages/button/src/Button Expand file tree Collapse file tree 1 file changed +18
-1
lines changed Original file line number Diff line number Diff line change @@ -146,7 +146,24 @@ describe('packages/button', () => {
146
146
test ( `renders a when passing in a NextJS Link wrapper` , ( ) => {
147
147
// eslint-disable-next-line react/prop-types
148
148
const Linker = ( { href, children, ...props } : any ) => (
149
- < NextLink href = { href } >
149
+ < NextLink href = { href } { ...props } >
150
+ { children }
151
+ </ NextLink >
152
+ ) ;
153
+
154
+ const { container, button } = renderButton ( {
155
+ href : 'https://mongodb.design' ,
156
+ as : Linker ,
157
+ } ) ;
158
+
159
+ expect ( container . querySelector ( 'button' ) ) . not . toBeInTheDocument ( ) ;
160
+ expect ( button . tagName . toLowerCase ( ) ) . toBe ( 'a' ) ;
161
+ } ) ;
162
+
163
+ test ( `renders a when passing in a legacy NextJS Link wrapper` , ( ) => {
164
+ // eslint-disable-next-line react/prop-types
165
+ const Linker = ( { href, children, ...props } : any ) => (
166
+ < NextLink legacyBehavior href = { href } >
150
167
< a { ...props } > { children } </ a >
151
168
</ NextLink >
152
169
) ;
You can’t perform that action at this time.
0 commit comments