@looker/components-test-utils
Advanced tools
Comparing version 1.5.26 to 1.5.27
@@ -6,27 +6,35 @@ "use strict"; | ||
}); | ||
exports.getAllComboboxOptionText = exports.getComboboxOptionText = exports.getComboboxOptions = exports.closeCombobox = exports.openCombobox = void 0; | ||
exports.openCombobox = exports.getComboboxOptions = exports.getComboboxOptionText = exports.getAllComboboxOptionText = exports.closeCombobox = void 0; | ||
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); |
@@ -25,12 +25,12 @@ "use strict"; | ||
}); | ||
Object.defineProperty(exports, "getComboboxOptions", { | ||
Object.defineProperty(exports, "getComboboxOptionText", { | ||
enumerable: true, | ||
get: function get() { | ||
return _comboboxHelpers.getComboboxOptions; | ||
return _comboboxHelpers.getComboboxOptionText; | ||
} | ||
}); | ||
Object.defineProperty(exports, "getComboboxOptionText", { | ||
Object.defineProperty(exports, "getComboboxOptions", { | ||
enumerable: true, | ||
get: function get() { | ||
return _comboboxHelpers.getComboboxOptionText; | ||
return _comboboxHelpers.getComboboxOptions; | ||
} | ||
@@ -37,0 +37,0 @@ }); |
@@ -7,11 +7,11 @@ "use strict"; | ||
var _create_with_theme = require("./create_with_theme"); | ||
var _with_theme = require("./with_theme"); | ||
Object.keys(_create_with_theme).forEach(function (key) { | ||
Object.keys(_with_theme).forEach(function (key) { | ||
if (key === "default" || key === "__esModule") return; | ||
if (key in exports && exports[key] === _create_with_theme[key]) return; | ||
if (key in exports && exports[key] === _with_theme[key]) return; | ||
Object.defineProperty(exports, key, { | ||
enumerable: true, | ||
get: function get() { | ||
return _create_with_theme[key]; | ||
return _with_theme[key]; | ||
} | ||
@@ -18,0 +18,0 @@ }); |
@@ -1,18 +0,7 @@ | ||
import "core-js/modules/es.array.map.js"; | ||
import { fireEvent, getNodeText, screen } from '@testing-library/react'; | ||
export var openCombobox = function openCombobox(placeholderText) { | ||
return fireEvent.mouseDown(screen.getByPlaceholderText(placeholderText)); | ||
}; | ||
export var closeCombobox = function closeCombobox() { | ||
return fireEvent.click(document); | ||
}; | ||
export var getComboboxOptions = function getComboboxOptions() { | ||
return screen.getAllByRole('option'); | ||
}; | ||
export var getComboboxOptionText = function getComboboxOptionText(el) { | ||
return getNodeText(el.children[1]); | ||
}; | ||
export var getAllComboboxOptionText = function getAllComboboxOptionText() { | ||
return getComboboxOptions().map(getComboboxOptionText); | ||
}; | ||
export const openCombobox = placeholderText => fireEvent.mouseDown(screen.getByPlaceholderText(placeholderText)); | ||
export const closeCombobox = () => fireEvent.click(document); | ||
export const getComboboxOptions = () => screen.getAllByRole('option'); | ||
export const getComboboxOptionText = el => getNodeText(el.children[1]); | ||
export const getAllComboboxOptionText = () => getComboboxOptions().map(getComboboxOptionText); | ||
//# sourceMappingURL=comboboxHelpers.js.map |
import { createEvent, fireEvent } from '@testing-library/react'; | ||
export function firePasteEvent(element, value) { | ||
var eventProperties = { | ||
const eventProperties = { | ||
clipboardData: { | ||
getData: function getData() { | ||
return value; | ||
} | ||
getData: () => value | ||
} | ||
}; | ||
var pasteEvent = createEvent.paste(element, eventProperties); | ||
const pasteEvent = createEvent.paste(element, eventProperties); | ||
fireEvent(element, pasteEvent); | ||
} | ||
//# sourceMappingURL=firePasteEvent.js.map |
@@ -1,2 +0,2 @@ | ||
export * from './create_with_theme'; | ||
export * from './with_theme'; | ||
export * from './helpers/react-testing-library'; |
@@ -1,3 +0,3 @@ | ||
export * from './create_with_theme'; | ||
export * from './with_theme'; | ||
export * from './helpers/react-testing-library'; | ||
//# sourceMappingURL=index.js.map |
{ | ||
"name": "@looker/components-test-utils", | ||
"license": "MIT", | ||
"version": "1.5.26", | ||
"version": "1.5.27", | ||
"sideEffects": false, | ||
"publishConfig": { | ||
"access": "public" | ||
"access": "public", | ||
"registry": "https://registry.npmjs.org" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/looker-open-source/components", | ||
"directory": "packages/components-test-utils" | ||
}, | ||
"peerDependencies": { | ||
"react": "^16.11", | ||
"react-is": "^16.11" | ||
"react": "16.14.0 - 18" | ||
}, | ||
"gitHead": "62febc162e3e45124f403e2c84fc741f68fe6714", | ||
"author": "Looker", | ||
"main": "cjs/index.js", | ||
"module": "index.js", | ||
"types": "index.d.ts", | ||
"repository": { | ||
"type": "git", | ||
"url": "https://github.com/looker-open-source/components", | ||
"directory": "packages/components-test-utils" | ||
} | ||
"types": "index.d.ts" | ||
} |
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
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
52634
1
36
199