2021-06-23 12:46:16 +00:00
|
|
|
import state from 'state'
|
2021-06-23 14:39:14 +00:00
|
|
|
import * as json from './__mocks__/document.json'
|
2021-06-23 12:46:16 +00:00
|
|
|
|
|
|
|
describe('project', () => {
|
2021-06-23 14:39:14 +00:00
|
|
|
state.reset()
|
|
|
|
state.enableLog(true)
|
2021-06-23 12:46:16 +00:00
|
|
|
|
2021-06-23 14:39:14 +00:00
|
|
|
it('mounts the state', () => {
|
|
|
|
state.send('MOUNTED')
|
|
|
|
expect(state.data.document).toMatchSnapshot('data after initial mount')
|
|
|
|
expect(state.isIn('ready')).toBe(true)
|
2021-06-23 12:46:16 +00:00
|
|
|
})
|
|
|
|
|
2021-06-23 14:39:14 +00:00
|
|
|
it('loads file from json', () => {
|
|
|
|
state.send('LOADED_FROM_FILE', { json: JSON.stringify(json) })
|
|
|
|
expect(state.isIn('ready')).toBe(true)
|
|
|
|
expect(state.data.document).toMatchSnapshot('data after mount from file')
|
2021-06-23 12:46:16 +00:00
|
|
|
})
|
|
|
|
})
|