Fix tests
This commit is contained in:
parent
03326adbaf
commit
0855a92497
6 changed files with 20 additions and 5 deletions
|
@ -6,7 +6,10 @@ import tld from 'utils/tld'
|
|||
jest.useRealTimers()
|
||||
|
||||
state.reset()
|
||||
state.send('MOUNTED').send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state.send('CLEARED_PAGE')
|
||||
|
||||
describe('selection', () => {
|
||||
|
|
|
@ -3,7 +3,10 @@ import coopState from 'state/coop/coop-state'
|
|||
import * as json from './__mocks__/document.json'
|
||||
|
||||
state.reset()
|
||||
state.send('MOUNTED').send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state.send('CLEARED_PAGE')
|
||||
|
||||
coopState.reset()
|
||||
|
|
|
@ -2,7 +2,10 @@ import state from 'state'
|
|||
import * as json from './__mocks__/document.json'
|
||||
|
||||
state.reset()
|
||||
state.send('MOUNTED').send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state.send('CLEARED_PAGE')
|
||||
|
||||
describe('arrow shape', () => {
|
||||
|
|
|
@ -6,7 +6,7 @@ describe('project', () => {
|
|||
state.enableLog(true)
|
||||
|
||||
it('mounts the state', () => {
|
||||
state.send('MOUNTED')
|
||||
state.send('MOUNTED').send('MOUNTED_SHAPES')
|
||||
|
||||
expect(state.isIn('ready')).toBe(true)
|
||||
})
|
||||
|
@ -26,6 +26,7 @@ describe('restoring project', () => {
|
|||
it('remounts the state after mutating the current state', () => {
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
.send('CLEARED_PAGE')
|
||||
|
||||
|
@ -35,6 +36,7 @@ describe('restoring project', () => {
|
|||
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
|
||||
expect(state.data.document).toMatchSnapshot('data after re-mount from file')
|
||||
|
|
|
@ -2,7 +2,10 @@ import state from 'state'
|
|||
import * as json from './__mocks__/document.json'
|
||||
|
||||
state.reset()
|
||||
state.send('MOUNTED').send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state
|
||||
.send('MOUNTED')
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
||||
state.send('CLEARED_PAGE')
|
||||
|
||||
describe('shape styles', () => {
|
||||
|
|
|
@ -45,6 +45,7 @@ class TestState {
|
|||
this.state
|
||||
.send('UNMOUNTED')
|
||||
.send('MOUNTED', { roomId: 'TESTING' })
|
||||
.send('MOUNTED_SHAPES')
|
||||
.send('LOADED_FROM_FILE', { json: JSON.stringify(mockDocument) })
|
||||
|
||||
return this
|
||||
|
|
Loading…
Reference in a new issue