Socket
Socket
Sign inDemoInstall

use-scan-detection

Package Overview
Dependencies
6
Maintainers
1
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

Comparing version 0.1.2 to 0.1.3

2

package.json
{
"name": "use-scan-detection",
"version": "0.1.2",
"version": "0.1.3",
"description": "A react hook for detecting barcode scanner input.",

@@ -5,0 +5,0 @@ "main": "dist/index.js",

@@ -141,2 +141,37 @@ import { renderHook, act } from '@testing-library/react-hooks'

})
it('should respect preventDefault', () => {
const config = {
onComplete: jest.fn(),
preventDefault: true
}
renderHook(() => useScanDetection(config))
const event = events[0]
const mockPreventDefault = jest.spyOn(event, "preventDefault")
document.dispatchEvent(event)
expect(mockPreventDefault)
.toHaveBeenCalled()
})
it('should respect stopPropagation', () => {
const config = {
onComplete: jest.fn(),
stopPropagation: true
}
renderHook(() => useScanDetection(config))
const event = events[0]
const mockStopPropagation = jest.spyOn(event, "stopPropagation")
document.dispatchEvent(event)
expect(mockStopPropagation)
.toHaveBeenCalled()
})
})
SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc