react-select-event
Advanced tools
Comparing version 2.1.1 to 2.1.2
@@ -79,3 +79,5 @@ 'use strict'; | ||
dom.fireEvent.click(container.querySelector('svg[aria-hidden="true"]')); | ||
const clearButton = container.querySelector('svg[aria-hidden="true"]'); | ||
dom.fireEvent.mouseDown(clearButton); | ||
dom.fireEvent.click(clearButton); | ||
}; | ||
@@ -92,4 +94,5 @@ /** | ||
const elements = container.querySelectorAll('svg[aria-hidden="true"]'); | ||
const element = elements[elements.length - 2]; | ||
dom.fireEvent.mouseDown(element); | ||
const clearAllButton = elements[elements.length - 2]; | ||
dom.fireEvent.mouseDown(clearAllButton); | ||
dom.fireEvent.click(clearAllButton); | ||
}; | ||
@@ -96,0 +99,0 @@ var index = { |
@@ -75,3 +75,5 @@ import { findByText, fireEvent } from '@testing-library/dom'; | ||
fireEvent.click(container.querySelector('svg[aria-hidden="true"]')); | ||
const clearButton = container.querySelector('svg[aria-hidden="true"]'); | ||
fireEvent.mouseDown(clearButton); | ||
fireEvent.click(clearButton); | ||
}; | ||
@@ -88,4 +90,5 @@ /** | ||
const elements = container.querySelectorAll('svg[aria-hidden="true"]'); | ||
const element = elements[elements.length - 2]; | ||
fireEvent.mouseDown(element); | ||
const clearAllButton = elements[elements.length - 2]; | ||
fireEvent.mouseDown(clearAllButton); | ||
fireEvent.click(clearAllButton); | ||
}; | ||
@@ -92,0 +95,0 @@ var index = { |
{ | ||
"name": "react-select-event", | ||
"version": "2.1.1", | ||
"version": "2.1.2", | ||
"description": "Simulate react-select events for react-testing-library", | ||
@@ -5,0 +5,0 @@ "main": "lib/react-select-event.cjs.js", |
@@ -81,3 +81,5 @@ /** Simulate user events on react-select dropdowns */ | ||
// The "clear" button is the first svg element that is hidden to screen readers | ||
fireEvent.click(container.querySelector('svg[aria-hidden="true"]')!); | ||
const clearButton = container.querySelector('svg[aria-hidden="true"]')!; | ||
fireEvent.mouseDown(clearButton); | ||
fireEvent.click(clearButton); | ||
}; | ||
@@ -94,6 +96,7 @@ | ||
const elements = container.querySelectorAll('svg[aria-hidden="true"]'); | ||
const element = elements[elements.length - 2]; | ||
fireEvent.mouseDown(element); | ||
const clearAllButton = elements[elements.length - 2]; | ||
fireEvent.mouseDown(clearAllButton); | ||
fireEvent.click(clearAllButton); | ||
}; | ||
export default { select, create, clearFirst, clearAll }; |
Sorry, the diff of this file is not supported yet
29216
545