@@ -61,8 +61,8 @@ describe('<AccountForm />', () => {
61
61
it ( 'handles form submission and calls updateSettings' , async ( ) => {
62
62
subject ( ) ;
63
63
64
- const saveAllSettingsButton = screen . getByRole ( 'button' , {
65
- name : / s a v e a l l s e t t i n g s / i
64
+ const saveAccountDetailsButton = screen . getByRole ( 'button' , {
65
+ name : / s a v e a c c o u n t d e t a i l s / i
66
66
} ) ;
67
67
68
68
const currentPasswordElement = screen . getByLabelText ( / c u r r e n t p a s s w o r d / i) ;
@@ -81,7 +81,7 @@ describe('<AccountForm />', () => {
81
81
} ) ;
82
82
83
83
await act ( async ( ) => {
84
- fireEvent . click ( saveAllSettingsButton ) ;
84
+ fireEvent . click ( saveAccountDetailsButton ) ;
85
85
} ) ;
86
86
87
87
await waitFor ( ( ) => {
@@ -92,8 +92,8 @@ describe('<AccountForm />', () => {
92
92
it ( 'Save all setting button should get disabled while submitting and enable when not submitting' , async ( ) => {
93
93
subject ( ) ;
94
94
95
- const saveAllSettingsButton = screen . getByRole ( 'button' , {
96
- name : / s a v e a l l s e t t i n g s / i
95
+ const saveAccountDetailsButton = screen . getByRole ( 'button' , {
96
+ name : / s a v e a c c o u n t d e t a i l s / i
97
97
} ) ;
98
98
99
99
const currentPasswordElement = screen . getByLabelText ( / c u r r e n t p a s s w o r d / i) ;
@@ -110,12 +110,12 @@ describe('<AccountForm />', () => {
110
110
value : 'newPassword'
111
111
}
112
112
} ) ;
113
- expect ( saveAllSettingsButton ) . not . toHaveAttribute ( 'disabled' ) ;
113
+ expect ( saveAccountDetailsButton ) . not . toHaveAttribute ( 'disabled' ) ;
114
114
115
115
await act ( async ( ) => {
116
- fireEvent . click ( saveAllSettingsButton ) ;
116
+ fireEvent . click ( saveAccountDetailsButton ) ;
117
117
await waitFor ( ( ) => {
118
- expect ( saveAllSettingsButton ) . toHaveAttribute ( 'disabled' ) ;
118
+ expect ( saveAccountDetailsButton ) . toHaveAttribute ( 'disabled' ) ;
119
119
} ) ;
120
120
} ) ;
121
121
} ) ;
0 commit comments