fix: correct UTC timestamp display and pre-existing code quality issues
This commit is contained in:
@@ -78,7 +78,7 @@ export function PendingDeviceModal({ device, onClose, onApprove, onHide, onIgnor
|
||||
|
||||
const TypeIcon = TYPE_ICONS[device.suggested_type ?? 'generic'] ?? Circle
|
||||
|
||||
const handleApprove = () => { onApprove(device); onClose() }
|
||||
const handleApprove = () => { onApprove(device) }
|
||||
const handleHide = () => { onHide(device); onClose() }
|
||||
const handleIgnore = () => { onIgnore(device); onClose() }
|
||||
|
||||
|
||||
@@ -126,7 +126,7 @@ describe('PendingDeviceModal', () => {
|
||||
|
||||
// ── Actions ───────────────────────────────────────────────────────────────
|
||||
|
||||
it('calls onApprove with the device and onClose when Approve is clicked', () => {
|
||||
it('calls onApprove with the device when Approve is clicked (parent controls close on success)', () => {
|
||||
const device = makeDevice()
|
||||
const onApprove = vi.fn()
|
||||
const onClose = vi.fn()
|
||||
@@ -135,7 +135,7 @@ describe('PendingDeviceModal', () => {
|
||||
)
|
||||
fireEvent.click(screen.getByRole('button', { name: 'Approve' }))
|
||||
expect(onApprove).toHaveBeenCalledWith(device)
|
||||
expect(onClose).toHaveBeenCalledOnce()
|
||||
expect(onClose).not.toHaveBeenCalled()
|
||||
})
|
||||
|
||||
it('calls onHide with the device and onClose when Hide is clicked', () => {
|
||||
|
||||
Reference in New Issue
Block a user