From 1aa241749bd34bafd60720620fa45158506288e5 Mon Sep 17 00:00:00 2001 From: picklesrus <picklesrus@users.noreply.github.com> Date: Tue, 12 Feb 2019 11:41:32 -0500 Subject: [PATCH] Fix up the tests and add a couple checks. --- test/unit/util/vm-manager-hoc.test.jsx | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/test/unit/util/vm-manager-hoc.test.jsx b/test/unit/util/vm-manager-hoc.test.jsx index 798e3a7e4..a1b913253 100644 --- a/test/unit/util/vm-manager-hoc.test.jsx +++ b/test/unit/util/vm-manager-hoc.test.jsx @@ -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(); -- GitLab