planning
All checks were successful
Publish To Prod / deploy_and_publish (push) Successful in 35s

This commit is contained in:
2024-10-14 09:15:30 +02:00
parent bcba00a730
commit 6e64e138e2
21059 changed files with 2317811 additions and 1 deletions

View File

@@ -0,0 +1,24 @@
const React = require('react');
const PropTypes = require('prop-types');
const ManagerContext = require('../../ManagerContext');
class MockWrapper extends React.Component {
static propTypes = {
mockManager: PropTypes.object.isRequired,
};
constructor(props) {
super(props);
this.manager = this.props.mockManager;
}
render() {
return React.createElement(
ManagerContext.Provider,
{ value: this.props.mockManager },
React.createElement('div', null, this.props.children)
);
}
}
module.exports = MockWrapper;

View File

@@ -0,0 +1,7 @@
module.exports = function(key, keyCode) {
return {
key: key,
keyCode: keyCode,
preventDefault: jest.fn(),
};
};

View File

@@ -0,0 +1,22 @@
module.exports = function() {
return {
isOpen: false,
toggleMenu: jest.fn(),
handleMenuKey: jest.fn(),
moveFocusDown: jest.fn(),
openMenu: jest.fn(),
handleKeyDown: jest.fn(),
handleClick: jest.fn(),
handleSelection: jest.fn(),
handleButtonNonArrowKey: jest.fn(),
focusItem: jest.fn(),
menuItems: [1, 2],
clearItems: jest.fn(),
currentFocus: -1,
addItem: jest.fn(),
options: {
closeOnBlur: true,
closeOnSelection: true
}
};
}

View File

@@ -0,0 +1,5 @@
import './raf';
import Enzyme from 'enzyme';
import Adapter from 'enzyme-adapter-react-16';
Enzyme.configure({ adapter: new Adapter() });

View File

@@ -0,0 +1,3 @@
global.requestAnimationFrame = (callback) => {
setTimeout(callback, 0);
};