Skip to content
Snippets Groups Projects
Commit 1aa24174 authored by picklesrus's avatar picklesrus
Browse files

Fix up the tests and add a couple checks.

parent ac0705c1
No related branches found
No related tags found
No related merge requests found
......@@ -19,11 +19,16 @@ describe('VMManagerHOC', () => {
projectState: {},
mode: {},
vmStatus: {}
},
locales: {
locale: '',
messages: {}
}
});
vm = new VM();
vm.attachAudioEngine = jest.fn();
vm.setCompatibilityMode = jest.fn();
vm.setLocale = jest.fn();
vm.start = jest.fn();
});
test('when it mounts in player mode, the vm is initialized but not started', () => {
......@@ -39,6 +44,7 @@ describe('VMManagerHOC', () => {
);
expect(vm.attachAudioEngine.mock.calls.length).toBe(1);
expect(vm.setCompatibilityMode.mock.calls.length).toBe(1);
expect(vm.setLocale.mock.calls.length).toBe(1);
expect(vm.initialized).toBe(true);
// But vm should not be started automatically
......@@ -57,6 +63,7 @@ describe('VMManagerHOC', () => {
);
expect(vm.attachAudioEngine.mock.calls.length).toBe(1);
expect(vm.setCompatibilityMode.mock.calls.length).toBe(1);
expect(vm.setLocale.mock.calls.length).toBe(1);
expect(vm.initialized).toBe(true);
expect(vm.start).toHaveBeenCalled();
......@@ -75,6 +82,7 @@ describe('VMManagerHOC', () => {
);
expect(vm.attachAudioEngine.mock.calls.length).toBe(0);
expect(vm.setCompatibilityMode.mock.calls.length).toBe(0);
expect(vm.setLocale.mock.calls.length).toBe(0);
expect(vm.initialized).toBe(true);
expect(vm.start).toHaveBeenCalled();
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment