Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More โ†’
Socket
Sign inDemoInstall
Socket

@testing-library/user-event

Package Overview
Dependencies
Maintainers
12
Versions
199
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@testing-library/user-event - npm Package Compare versions

Comparing version 8.0.6 to 8.0.7

18

__tests__/react/click.js

@@ -324,2 +324,20 @@ import React from "react";

});
it.each(["input", "textarea"])(
"should not give focus for <%s> when mouseDown is prevented",
type => {
const { getByTestId } = render(
React.createElement(type, {
"data-testid": "element",
onMouseDown: (evt) => {
evt.preventDefault();
},
})
);
userEvent.click(getByTestId("element"));
expect(getByTestId("element")).not.toHaveFocus();
}
);
});

6

dist/index.js

@@ -66,5 +66,7 @@ "use strict";

_dom.fireEvent.mouseDown(element);
const continueDefaultHandling = _dom.fireEvent.mouseDown(element);
element.focus();
if (continueDefaultHandling) {
element.focus();
}

@@ -71,0 +73,0 @@ _dom.fireEvent.mouseUp(element);

{
"name": "@testing-library/user-event",
"version": "8.0.6",
"version": "8.0.7",
"description": "Simulate user events for react-testing-library",

@@ -5,0 +5,0 @@ "keywords": [

@@ -259,2 +259,3 @@ <div align="center">

<td align="center"><a href="http://jagascript.com"><img src="https://avatars0.githubusercontent.com/u/4562878?v=4" width="100px;" alt=""/><br /><sub><b>Jaga Santagostino</b></sub></a><br /><a href="https://github.com/testing-library/user-event/commits?author=kandros" title="Code">๐Ÿ’ป</a> <a href="https://github.com/testing-library/user-event/commits?author=kandros" title="Tests">โš ๏ธ</a></td>
<td align="center"><a href="http://jordy.app"><img src="https://avatars3.githubusercontent.com/u/12712484?v=4" width="100px;" alt=""/><br /><sub><b>jordyvandomselaar</b></sub></a><br /><a href="https://github.com/testing-library/user-event/commits?author=jordyvandomselaar" title="Code">๐Ÿ’ป</a> <a href="https://github.com/testing-library/user-event/commits?author=jordyvandomselaar" title="Tests">โš ๏ธ</a></td>
</tr>

@@ -261,0 +262,0 @@ </table>

@@ -47,4 +47,6 @@ import { fireEvent } from "@testing-library/dom";

fireEvent.mouseMove(element);
fireEvent.mouseDown(element);
element.focus();
const continueDefaultHandling = fireEvent.mouseDown(element);
if (continueDefaultHandling) {
element.focus();
}
fireEvent.mouseUp(element);

@@ -51,0 +53,0 @@ fireEvent.click(element);

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with โšก๏ธ by Socket Inc