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
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+ onContextMenu={[Function]}
+ style={
+ Object {
+ "height": "100%",
+ "width": "100%",
+ }
+ }
+ >
+
+
+
+
-
`;
diff --git a/js/components/MainWindow/index.test.js b/js/components/MainWindow/index.test.js
index 3299d050..4e8d4c4b 100644
--- a/js/components/MainWindow/index.test.js
+++ b/js/components/MainWindow/index.test.js
@@ -1,21 +1,12 @@
import React from "react";
import { Provider } from "react-redux";
import renderer from "react-test-renderer";
-import getStore from "../../store";
+import mockGetStore from "../../__mocks__/storeMock";
+import media from "../../__mocks__/mediaMock";
import { SET_SKIN_DATA } from "../../actionTypes";
-import Emitter from "../../emitter";
import MainWindow from "./index";
-const media = {
- addEventListener: jest.fn(),
- setVolume: jest.fn(),
- setBalance: jest.fn(),
- setPreamp: jest.fn(),
- getAnalyser: () => null,
- on: jest.fn(),
-};
-
const canvasMockify = require("canvas-mock");
function createNodeMock(element) {
@@ -30,7 +21,7 @@ function createNodeMock(element) {
describe("MainWindow", () => {
let store;
beforeEach(() => {
- store = getStore(media, new Emitter());
+ store = mockGetStore();
store.dispatch({ type: SET_SKIN_DATA, data: {} });
});
diff --git a/js/components/PlaylistWindow/__snapshots__/index.test.js.snap b/js/components/PlaylistWindow/__snapshots__/index.test.js.snap
index 8d5aa782..7b82598a 100644
--- a/js/components/PlaylistWindow/__snapshots__/index.test.js.snap
+++ b/js/components/PlaylistWindow/__snapshots__/index.test.js.snap
@@ -8,7 +8,6 @@ exports[`PlaylistWindow renders to snapshot 1`] = `
onDragOver={[Function]}
onDragStart={[Function]}
onDrop={[Function]}
- onMouseDown={[Function]}
onWheel={[Function]}
style={
Object {
@@ -21,404 +20,415 @@ exports[`PlaylistWindow renders to snapshot 1`] = `
}
>
-
-
-
-
+
+
+
+
+
+
+
+
+
+
+ 0
+
+
+ :
+
+
+ 0
+
+
+ 0
+
+
+ /
+
+
+ 0
+
+
+ :
+
+
+ 0
+
+
+ 0
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
- 0
+
- :
+
- 0
+
- 0
+
- /
-
-
- 0
-
-
- :
-
-
- 0
-
-
- 0
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-