@@ -41,15 +41,15 @@ describe("PasswordFormField", () => {
4141
4242 test ( "when has errorMessage prop, renders with error message" , ( ) => {
4343 // Arrange
44- const testLabel = faker . random . words ( ) ;
4544 const testErrorMessage = faker . random . words ( ) ;
45+ const testLabel = faker . random . words ( ) ;
4646
4747 // Act
4848 const { getByText } = render (
4949 < PasswordFormField
50+ errorMessage = { testErrorMessage }
5051 label = { testLabel }
5152 onChange = { ( ) => { } }
52- errorMessage = { testErrorMessage }
5353 />
5454 ) ;
5555
@@ -65,8 +65,8 @@ describe("PasswordFormField", () => {
6565 // Act
6666 const { container } = render (
6767 < PasswordFormField
68- onChange = { ( ) => { } }
6968 label = { testLabel }
69+ onChange = { ( ) => { } }
7070 required = { true }
7171 />
7272 ) ;
@@ -83,8 +83,8 @@ describe("PasswordFormField", () => {
8383 // Act
8484 const { getByText } = render (
8585 < PasswordFormField
86- onChange = { ( ) => { } }
8786 label = { testLabel }
87+ onChange = { ( ) => { } }
8888 value = { faker . random . word ( ) }
8989 />
9090 ) ;
@@ -102,10 +102,10 @@ describe("PasswordFormField", () => {
102102 // Act
103103 const { container, getByText } = render (
104104 < PasswordFormField
105- onChange = { ( ) => { } }
105+ disabled = { true }
106106 label = { testLabel }
107+ onChange = { ( ) => { } }
107108 value = { faker . random . word ( ) }
108- disabled = { true }
109109 />
110110 ) ;
111111 const htmlInputElement = container . getElementsByTagName ( "input" ) ;
@@ -116,14 +116,14 @@ describe("PasswordFormField", () => {
116116
117117 test ( `when isValid prop is false, renders with ${ InvalidInputClassName } class name` , ( ) => {
118118 // Arrange
119- const label = faker . random . words ( ) ;
119+ const testLabel = faker . random . words ( ) ;
120120
121121 // Act
122122 const { container } = render (
123123 < PasswordFormField
124- onChange = { ( ) => { } }
125- label = { label }
126124 isValid = { false }
125+ label = { testLabel }
126+ onChange = { ( ) => { } }
127127 />
128128 ) ;
129129 const result = container . getElementsByClassName ( InvalidInputClassName ) ;
0 commit comments