mirror of
https://github.com/wassname/talk.git
synced 2026-09-11 12:51:33 +08:00
Focus RTE when opening reply
This commit is contained in:
@@ -1,25 +1,4 @@
|
||||
import "jest-localstorage-mock";
|
||||
import "./enzyme";
|
||||
import "./jsdom";
|
||||
|
||||
// TODO: Remove when fixed.
|
||||
// Mock React.createContext because of https://github.com/airbnb/enzyme/issues/1509.
|
||||
function mockReact() {
|
||||
const originalReact = require.requireActual("react");
|
||||
return {
|
||||
...originalReact,
|
||||
createContext: jest.fn(defaultValue => {
|
||||
let value = defaultValue;
|
||||
const Provider = (props: any) => {
|
||||
value = props.value;
|
||||
return props.children;
|
||||
};
|
||||
const Consumer = (props: any) => props.children(value);
|
||||
return {
|
||||
Provider,
|
||||
Consumer,
|
||||
};
|
||||
}),
|
||||
};
|
||||
}
|
||||
jest.mock("react", () => mockReact());
|
||||
import "./mocks";
|
||||
|
||||
Reference in New Issue
Block a user