Fix tests

This commit is contained in:
Steve Ruiz 2021-07-14 09:08:12 +01:00
parent 03326adbaf
commit 0855a92497
6 changed files with 20 additions and 5 deletions

View file

@ -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', () => {

View file

@ -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()

View 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('arrow shape', () => {

View file

@ -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')

View 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', () => {

View file

@ -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