Fix some tests (but not all)

This commit is contained in:
Jordan Eldredge 2017-12-19 07:18:00 -08:00
parent 56a5388cdf
commit 2a43de28cb
7 changed files with 21 additions and 3 deletions

View file

@ -1,5 +1,7 @@
const media = {
addEventListener: jest.fn(),
setVolume: jest.fn(),
setBalance: jest.fn(),
_analyser: null
};

View file

@ -253,12 +253,12 @@ exports[`MainWindow renders to snapshot 1`] = `
step="1"
style={
Object {
"backgroundPosition": "0 -195px",
"backgroundPosition": "0 -315px",
}
}
title="Volume Bar"
type="range"
value={50}
value={78}
/>
<input
className={undefined}

View file

@ -1,5 +1,7 @@
const media = {
addEventListener: jest.fn(),
setVolume: jest.fn(),
setBalance: jest.fn(),
_analyser: null
};

View file

@ -1,6 +1,8 @@
const media = {
addEventListener: jest.fn(),
loadFromUrl: jest.fn(),
setVolume: jest.fn(),
setBalance: jest.fn(),
_analyser: null
};

View file

@ -51,6 +51,12 @@ exports[`PlaylistWindow renders to snapshot 1`] = `
>
<div
className="playlist-tracks"
onClick={[Function]}
style={
Object {
"height": "100%",
}
}
>
<div
className="playlist-track-numbers"

View file

@ -1,5 +1,7 @@
const media = {
addEventListener: jest.fn(),
setVolume: jest.fn(),
setBalance: jest.fn(),
_analyser: null
};

View file

@ -206,7 +206,11 @@ const playlist = (state = defaultPlaylistState, action) => {
export default playlist;
export const getTrackDisplayName = (state, id) => {
const { artist, title } = state.tracks[id];
const track = state.tracks[id];
if (track == null) {
return null;
}
const { artist, title } = track;
if (artist && title) {
return `${artist} - ${title}`;
} else if (title) {