1- import { fireEvent , render , screen , waitFor } from '@testing-library/react' ;
1+ import { fireEvent , render , screen } from '@testing-library/react' ;
22import { NHSNotifyButton } from '@atoms/NHSNotifyButton/NHSNotifyButton' ;
33
4- describe . only ( 'NHS Notify button' , ( ) => {
4+ describe ( 'NHS Notify button' , ( ) => {
55 it ( 'renders component correctly as a button' , ( ) => {
6- render ( < NHSNotifyButton data-testid = 'button' > Button text</ NHSNotifyButton > ) ;
6+ render (
7+ < NHSNotifyButton data-testid = 'button' > Button text</ NHSNotifyButton >
8+ ) ;
79
810 expect ( screen . getByTestId ( 'button' ) ) . toBeInTheDocument ( ) ;
911 expect ( screen . getByTestId ( 'button' ) ) . toHaveTextContent ( 'Button text' ) ;
1012 } ) ;
1113
1214 it ( 'renders component correctly as a link button' , ( ) => {
13- render ( < NHSNotifyButton data-testid = 'link-button' href = "#" > Button text</ NHSNotifyButton > ) ;
15+ render (
16+ < NHSNotifyButton data-testid = 'link-button' href = '#' >
17+ { ' ' }
18+ Button text
19+ </ NHSNotifyButton >
20+ ) ;
1421
1522 expect ( screen . getByTestId ( 'link-button' ) ) . toBeInTheDocument ( ) ;
1623 expect ( screen . getByTestId ( 'link-button' ) ) . toHaveTextContent ( 'Button text' ) ;
@@ -20,7 +27,12 @@ describe.only('NHS Notify button', () => {
2027 it ( 'debounces multiple clicks' , async ( ) => {
2128 const onClick = jest . fn ( ) ;
2229
23- render ( < NHSNotifyButton data-testid = 'button' onClick = { onClick } > Button text</ NHSNotifyButton > ) ;
30+ render (
31+ < NHSNotifyButton data-testid = 'button' onClick = { onClick } >
32+ { ' ' }
33+ Button text
34+ </ NHSNotifyButton >
35+ ) ;
2436
2537 const button = screen . getByTestId ( 'button' ) ;
2638
@@ -35,7 +47,9 @@ describe.only('NHS Notify button', () => {
3547 } ) ;
3648
3749 it ( 'default onClick does nothing' , async ( ) => {
38- const container = render ( < NHSNotifyButton data-testid = 'button' > Button text</ NHSNotifyButton > ) ;
50+ const container = render (
51+ < NHSNotifyButton data-testid = 'button' > Button text</ NHSNotifyButton >
52+ ) ;
3953
4054 const button = screen . getByTestId ( 'button' ) ;
4155
0 commit comments