diff --git a/js/__mocks__/mediaMock.js b/js/__mocks__/mediaMock.js new file mode 100644 index 00000000..ccec2a2c --- /dev/null +++ b/js/__mocks__/mediaMock.js @@ -0,0 +1,9 @@ +const media = { + addEventListener: jest.fn(), + setVolume: jest.fn(), + setBalance: jest.fn(), + setPreamp: jest.fn(), + getAnalyser: () => null, + on: jest.fn(), +}; +export default media; diff --git a/js/__mocks__/storeMock.js b/js/__mocks__/storeMock.js new file mode 100644 index 00000000..4017830f --- /dev/null +++ b/js/__mocks__/storeMock.js @@ -0,0 +1,7 @@ +import getStore from "../store"; +import Emitter from "../emitter"; +import media from "./mediaMock"; + +export default function mockGetStore() { + return getStore(media, new Emitter()); +} diff --git a/js/components/EqualizerWindow/__snapshots__/index.test.js.snap b/js/components/EqualizerWindow/__snapshots__/index.test.js.snap index da4b09ba..3de34868 100644 --- a/js/components/EqualizerWindow/__snapshots__/index.test.js.snap +++ b/js/components/EqualizerWindow/__snapshots__/index.test.js.snap @@ -4,538 +4,548 @@ exports[`EqualizerWindow renders to snapshot 1`] = `
-
-
+
+
+
+
+
+
-
-
-
- -
+
+
+
+
+
+
-
-
-
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
-
-
+
+
+
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
-
-
-
+
+
-
-
-
+ /> +
+
+
+
diff --git a/js/components/GenWindow/__snapshots__/index.test.js.snap b/js/components/GenWindow/__snapshots__/index.test.js.snap index 033d6bf2..9cc5c70d 100644 --- a/js/components/GenWindow/__snapshots__/index.test.js.snap +++ b/js/components/GenWindow/__snapshots__/index.test.js.snap @@ -2,107 +2,117 @@ exports[`GenWindow renders to snapshot 1`] = `
-
-
-
+
+
+
+
+
+
+
+
+
+
+
-
-
-
+ className="gen-top-right draggable" + > +
+
-
-
-
-
-
-
+ className="gen-middle-left draggable" + > +
+
+
+
+
-
-
-
-
-
-
+ className="gen-bottom-right draggable" + > +
+
diff --git a/js/components/GenWindow/index.test.js b/js/components/GenWindow/index.test.js index d2654783..2226f7f2 100644 --- a/js/components/GenWindow/index.test.js +++ b/js/components/GenWindow/index.test.js @@ -1,22 +1,30 @@ import React from "react"; +import { Provider } from "react-redux"; import renderer from "react-test-renderer"; +import mockGetStore from "../../__mocks__/storeMock"; import { GenWindow } from "./index"; describe("GenWindow", () => { + let store; + beforeEach(() => { + store = mockGetStore(); + }); it("renders to snapshot", () => { const tree = renderer .create( - {}} - windowId="TEST_WINDOW_ID" - scrollVolume={() => {}} - windowSize={[0, 0]} - > - {() => {}} - + + {}} + windowId="TEST_WINDOW_ID" + scrollVolume={() => {}} + windowSize={[0, 0]} + > + {() => {}} + + ) .toJSON(); expect(tree).toMatchSnapshot(); diff --git a/js/components/MainWindow/__snapshots__/index.test.js.snap b/js/components/MainWindow/__snapshots__/index.test.js.snap index 1d5ff940..c7fe4390 100644 --- a/js/components/MainWindow/__snapshots__/index.test.js.snap +++ b/js/components/MainWindow/__snapshots__/index.test.js.snap @@ -8,64 +8,26 @@ exports[`MainWindow renders to snapshot 1`] = ` onDragOver={[Function]} onDragStart={[Function]} onDrop={[Function]} - onMouseDown={[Function]} onWheel={[Function]} >
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- -
-
-
- +
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ +
+
+
- W - - - i - - - n - - - a - - - m - - - p - - - - - - 2 - - - . - - - 9 - - - 1 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + + W + + + i + + + n + + + a + + + m + + + p + + + + + + 2 + + + . + + + 9 + + + 1 + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
+
+
+
+
+
+
-
-
-
-
-
-
-
- -
-
-
- -
-