@looker/components-test-utils
Advanced tools
Comparing version 1.1.0 to 1.1.1
@@ -6,2 +6,10 @@ # Change Log | ||
## [1.1.1](https://github.com/looker-open-source/components/compare/v1.1.0...v1.1.1) (2021-03-31) | ||
**Note:** Version bump only for package @looker/components-test-utils | ||
# [1.1.0](https://github.com/looker-open-source/components/compare/v1.0.0...v1.1.0) (2021-03-31) | ||
@@ -8,0 +16,0 @@ |
@@ -18,11 +18,15 @@ "use strict"; | ||
const withThemeProvider = Component => _react2.default.createElement(_componentsProviders.ComponentsProvider, { | ||
globalStyle: false | ||
}, Component); | ||
var withThemeProvider = function withThemeProvider(Component) { | ||
return _react2.default.createElement(_componentsProviders.ComponentsProvider, { | ||
globalStyle: false | ||
}, Component); | ||
}; | ||
exports.withThemeProvider = withThemeProvider; | ||
const renderWithTheme = (Component, options) => (0, _react.render)(withThemeProvider(Component), options); | ||
var renderWithTheme = function renderWithTheme(Component, options) { | ||
return (0, _react.render)(withThemeProvider(Component), options); | ||
}; | ||
exports.renderWithTheme = renderWithTheme; | ||
//# sourceMappingURL=create_with_theme.js.map |
@@ -8,25 +8,33 @@ "use strict"; | ||
require("core-js/modules/es.array.map.js"); | ||
var _react = require("@testing-library/react"); | ||
const openCombobox = placeholderText => _react.fireEvent.mouseDown(_react.screen.getByPlaceholderText(placeholderText)); | ||
var openCombobox = function openCombobox(placeholderText) { | ||
return _react.fireEvent.mouseDown(_react.screen.getByPlaceholderText(placeholderText)); | ||
}; | ||
exports.openCombobox = openCombobox; | ||
const closeCombobox = () => _react.fireEvent.click(document); | ||
var closeCombobox = function closeCombobox() { | ||
return _react.fireEvent.click(document); | ||
}; | ||
exports.closeCombobox = closeCombobox; | ||
const getComboboxOptions = () => _react.screen.getAllByRole('option'); | ||
var getComboboxOptions = function getComboboxOptions() { | ||
return _react.screen.getAllByRole('option'); | ||
}; | ||
exports.getComboboxOptions = getComboboxOptions; | ||
const getComboboxOptionText = el => (0, _react.getNodeText)(el.children[1]); | ||
var getComboboxOptionText = function getComboboxOptionText(el) { | ||
return (0, _react.getNodeText)(el.children[1]); | ||
}; | ||
exports.getComboboxOptionText = getComboboxOptionText; | ||
const getAllComboboxOptionText = () => getComboboxOptions().map(getComboboxOptionText); | ||
var getAllComboboxOptionText = function getAllComboboxOptionText() { | ||
return getComboboxOptions().map(getComboboxOptionText); | ||
}; | ||
exports.getAllComboboxOptionText = getAllComboboxOptionText; | ||
//# sourceMappingURL=comboboxHelpers.js.map |
@@ -11,9 +11,11 @@ "use strict"; | ||
function firePasteEvent(element, value) { | ||
const eventProperties = { | ||
var eventProperties = { | ||
clipboardData: { | ||
getData: () => value | ||
getData: function getData() { | ||
return value; | ||
} | ||
} | ||
}; | ||
const pasteEvent = _react.createEvent.paste(element, eventProperties); | ||
var pasteEvent = _react.createEvent.paste(element, eventProperties); | ||
@@ -20,0 +22,0 @@ (0, _react.fireEvent)(element, pasteEvent); |
@@ -1,2 +0,1 @@ | ||
import "core-js/modules/es.array.map.js"; | ||
import { fireEvent, getNodeText, screen } from '@testing-library/react'; | ||
@@ -3,0 +2,0 @@ export var openCombobox = function openCombobox(placeholderText) { |
{ | ||
"name": "@looker/components-test-utils", | ||
"license": "MIT", | ||
"version": "1.1.0", | ||
"version": "1.1.1", | ||
"main": "lib/cjs/index.js", | ||
@@ -21,3 +21,3 @@ "module": "lib/index.js", | ||
"devDependencies": { | ||
"@looker/components-providers": "^1.1.0", | ||
"@looker/components-providers": "^1.1.1", | ||
"@testing-library/react": "^11.2.2", | ||
@@ -35,3 +35,3 @@ "@types/jest": "^26.0.19", | ||
}, | ||
"gitHead": "fcfdb4d0babe5d63b355516fe09e8f9c608c390a" | ||
"gitHead": "e1ce2b55aef13339f01385749cd4cf34c5c8fdeb" | ||
} |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
34575
203