Skip to content

Commit

Permalink
Fix tests
Browse files Browse the repository at this point in the history
  • Loading branch information
Murias10 committed Apr 28, 2024
1 parent 262a205 commit cb331f8
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 7 deletions.
4 changes: 2 additions & 2 deletions webapp/src/components/AddUser/AddUser.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,13 +108,13 @@ const AddUser = () => {
/>
<p className="form-error">{formErrors.username}</p>

<PasswordField placeholder={t("register.password_placeholder")} password={password} setPassword={setPassword} />
<PasswordField id="password" name="password" placeholder={t("register.password_placeholder")} password={password} setPassword={setPassword} />

<PasswordStrengthBar password={password} shortScoreWord={t("register.strength.very_week")} scoreWords={strengthWords} minLength={8} />

<p className="form-error">{formErrors.password}</p>

<PasswordField placeholder={t("register.password_confirm_placeholder")} password={repeatPassword} setPassword={setRepeatPassword} />
<PasswordField id="repeatPassword" name="repeatPassword" placeholder={t("register.password_confirm_placeholder")} password={repeatPassword} setPassword={setRepeatPassword} />

<p className="form-error">{formErrors.repeatPassword}</p>

Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/Login/Login.js
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ const Login = () => {
/>
<p className="form-error">{formErrors.username}</p>

<PasswordField placeholder={t("login.password_placeholder")} password={password} setPassword={setPassword} />
<PasswordField id="password" name="password" placeholder={t("login.password_placeholder")} password={password} setPassword={setPassword} />

<p className="form-error">{formErrors.password}</p>
<button className="button-common" onClick={loginHandler}>
Expand Down
6 changes: 3 additions & 3 deletions webapp/src/components/PasswordField/PasswordField.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,16 +5,16 @@ import VisibilityRoundedIcon from '@mui/icons-material/VisibilityRounded';

import './PasswordField.css'

const PasswordField = ({ placeholder, password, setPassword }) => {
const PasswordField = ({ id, name, placeholder, password, setPassword }) => {

const [showPassword, setShowPassword] = useState(false);

return (
<div className="input-box">
<input
type={showPassword ? "text" : "password"}
name="password"
id="password"
name={name}
id={id}
placeholder={placeholder}
onChange={e => setPassword(e.target.value)}
value={password}
Expand Down
2 changes: 1 addition & 1 deletion webapp/src/components/test/PasswordField.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ const renderPasswordField = _ =>
render(
<MemoryRouter>
<I18nextProvider i18n={i18n}>
<PasswordField placeholder={"placeholder"} password="12345678" setPassword={() => { }} />
<PasswordField id="password" name="password" placeholder={"placeholder"} password="12345678" setPassword={() => { }} />
</I18nextProvider>
</MemoryRouter>
)
Expand Down

0 comments on commit cb331f8

Please sign in to comment.