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.4 to 8.0.5

20

__tests__/react/tab.js

@@ -248,1 +248,21 @@ import React from "react";

});
it("should not focus disabled elements", () => {
const { getByTestId } = render(
<div>
<input data-testid="one" />
<input tabIndex={-1} />
<button disabled>click</button>
<input disabled />
<input data-testid="five" />
</div>
);
const [one, five] = [getByTestId("one"), getByTestId("five")];
userEvent.tab();
expect(one).toHaveFocus();
userEvent.tab();
expect(five).toHaveFocus();
});

2

dist/index.js

@@ -299,3 +299,3 @@ "use strict";

let list = Array.prototype.filter.call(focusableElements, function (item) {
return item.getAttribute("tabindex") !== "-1";
return item.getAttribute("tabindex") !== "-1" && !item.disabled;
}).map((el, idx) => ({

@@ -302,0 +302,0 @@ el,

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

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

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

);
let list = Array.prototype.filter.call(focusableElements, function (item) {
return item.getAttribute("tabindex") !== "-1";
return item.getAttribute("tabindex") !== "-1"&& !item.disabled;
}).map((el, idx) => ({ el, idx }))

@@ -248,0 +249,0 @@ .sort((a, b) => {

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