Just a whole lot of crap
This commit is contained in:
21
tests/__mocks__/ink-select-input.js
Normal file
21
tests/__mocks__/ink-select-input.js
Normal file
@@ -0,0 +1,21 @@
|
||||
// Mock ink-select-input for testing
|
||||
const React = require("react");
|
||||
|
||||
const SelectInput = ({ items, onSelect, ...props }) =>
|
||||
React.createElement(
|
||||
"select",
|
||||
{
|
||||
...props,
|
||||
onChange: (e) => onSelect && onSelect(items[e.target.selectedIndex]),
|
||||
},
|
||||
items.map((item, index) =>
|
||||
React.createElement(
|
||||
"option",
|
||||
{ key: index, value: item.value },
|
||||
item.label
|
||||
)
|
||||
)
|
||||
);
|
||||
|
||||
module.exports = SelectInput;
|
||||
module.exports.default = SelectInput;
|
||||
Reference in New Issue
Block a user