Focus RTE when opening reply

This commit is contained in:
Chi Vinh Le
2018-09-06 00:06:58 +02:00
parent 110becb075
commit 444c86cb3c
26 changed files with 143 additions and 56 deletions
+1 -22
View File
@@ -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";