test: add data-testid attributes to admin sub-components and modals
This commit is contained in:
@@ -70,7 +70,7 @@ export default function CreateUserModal({ show, onClose, onUserCreated }: Create
|
||||
const isFormValid = username.trim() && password.length >= 6 && !Object.keys(errors).length;
|
||||
|
||||
return (
|
||||
<div className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
|
||||
<div data-testid="create-user-modal" className="fixed inset-0 z-50 flex items-center justify-center bg-black/40">
|
||||
<div className="bg-surface border border-slate-800 rounded-lg shadow-xl max-w-sm w-full mx-4">
|
||||
{/* Header */}
|
||||
<div className="flex items-center justify-between p-6 border-b border-slate-800">
|
||||
@@ -93,6 +93,7 @@ export default function CreateUserModal({ show, onClose, onUserCreated }: Create
|
||||
</label>
|
||||
<input
|
||||
id="username"
|
||||
data-testid="new-user-name"
|
||||
type="text"
|
||||
value={username}
|
||||
onChange={(e) => {
|
||||
@@ -117,6 +118,7 @@ export default function CreateUserModal({ show, onClose, onUserCreated }: Create
|
||||
</label>
|
||||
<input
|
||||
id="password"
|
||||
data-testid="new-user-password"
|
||||
type="password"
|
||||
value={password}
|
||||
onChange={(e) => {
|
||||
@@ -146,6 +148,7 @@ export default function CreateUserModal({ show, onClose, onUserCreated }: Create
|
||||
</button>
|
||||
<button
|
||||
type="submit"
|
||||
data-testid="create-user-submit"
|
||||
disabled={!isFormValid || loading}
|
||||
className="flex-1 px-4 py-2.5 bg-primary text-primary-foreground rounded font-semibold hover:bg-blue-600 transition-colors disabled:opacity-50 flex items-center justify-center gap-2 focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-offset-slate-900 focus-visible:ring-primary focus-visible:outline-none"
|
||||
>
|
||||
|
||||
Reference in New Issue
Block a user