test: add data-testid to mode buttons, admin button, and quantity controls
This commit is contained in:
@@ -592,6 +592,7 @@ export default function Home() {
|
||||
].map((m) => (
|
||||
<button
|
||||
key={m.id}
|
||||
data-testid={m.id === 'CHECK_IN' ? 'operation-checkin' : m.id === 'CHECK_OUT' ? 'operation-checkout' : undefined}
|
||||
onClick={() => setMode(m.id as any)}
|
||||
className={cn(
|
||||
"flex-1 py-3.5 rounded-xl text-xs sm:text-sm font-black transition-all flex items-center justify-center gap-3",
|
||||
@@ -872,7 +873,7 @@ export default function Home() {
|
||||
>
|
||||
<Minus size={24} />
|
||||
</button>
|
||||
<div className="text-center">
|
||||
<div className="text-center" data-testid="adjustment-quantity-input">
|
||||
<span className="text-xs font-black tabular-nums">{adjustQty}</span>
|
||||
<span className="text-[10px] text-primary/80 font-bold tracking-tight">Units</span>
|
||||
</div>
|
||||
|
||||
@@ -60,6 +60,7 @@ export default function BottomNav({
|
||||
{/* Admin Settings */}
|
||||
{currentUser?.role === 'admin' && (
|
||||
<button
|
||||
data-testid="admin-button"
|
||||
onClick={() => router.push('/admin')}
|
||||
aria-label="Go to Admin"
|
||||
className={cn("flex flex-col items-center gap-1 rounded px-2 py-1 cursor-pointer transition-colors focus:ring-2 focus:ring-primary focus:outline-none", isAdmin && "text-primary")}
|
||||
|
||||
Reference in New Issue
Block a user