| author | ymh <ymh.work@gmail.com> |
| Mon, 08 Oct 2018 18:35:47 +0200 | |
| changeset 168 | ea92f4fe783d |
| parent 8 | 6f572b6b6be3 |
| permissions | -rw-r--r-- |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
1 |
import React from 'react'; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
2 |
import ReactDOM from 'react-dom'; |
|
168
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
3 |
import { Provider } from 'react-redux'; |
|
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
4 |
import { MemoryRouter } from 'react-router'; |
|
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
5 |
import { createMemoryHistory } from 'history' |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
6 |
|
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
7 |
import App from '../App'; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
8 |
import configureStore from '../store/configureStore'; |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
9 |
|
| 8 | 10 |
beforeAll(() => { |
11 |
window.getSelection = () => { |
|
12 |
return { |
|
13 |
removeAllRanges: () => {} |
|
14 |
}; |
|
15 |
}; |
|
16 |
}); |
|
17 |
||
|
168
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
18 |
const history = createMemoryHistory(); |
|
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
19 |
const { store } = configureStore(history); |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
20 |
|
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
21 |
it('renders without crashing', () => { |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
22 |
const div = document.createElement('div'); |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
23 |
ReactDOM.render( |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
24 |
<Provider store={store}> |
|
168
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
25 |
<MemoryRouter> |
|
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
26 |
<App /> |
|
ea92f4fe783d
- move SlateEditor and dependencies to its own folder
ymh <ymh.work@gmail.com>
parents:
8
diff
changeset
|
27 |
</MemoryRouter> |
|
3
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
28 |
</Provider>, |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
29 |
div); |
|
3b5d37d84cfe
Some code rename and reorg + basic tests
ymh <ymh.work@gmail.com>
parents:
diff
changeset
|
30 |
}); |