/**
 * @description Unit tests for src/reducers/item-display.js
 */

import assert     from 'assert';
import reducer    from 'reducers/item-display';
import * as types from 'actions/action-types';

describe('reducers/item-display.js test', () => {
  it('Should return default state.', () => {
    const expected = [];

    assert.equal(expected, reducer(expected, {}));
  });

  it('Should handle CLICK_MUSIC_ITEM', () => {
    const action = {
      type     : types.CLICK_MUSIC_ITEM,
      id       : 1235,
      songName : 'song-name',
    };
    const expected = {
      id       : action.id,
      songName : action.songName,
    };

    assert.deepEqual(expected, reducer([], action));
  });

  it('Should override state when CLICK_MUSIC_ITEM', () => {
    const state = [
      {
        id       : 1236,
        songName : 'another-song-name',
      }
    ];
    const action = {
      type     : types.CLICK_MUSIC_ITEM,
      id       : 1235,
      songName : 'song-name',
    };
    const expected = {
      id       : action.id,
      songName : action.songName,
    };

    assert.deepEqual(expected, reducer(state, action));
  });
});

@@ -323,17 +323,21 @@
  assert.
-e
+deepE
 qual(exp
@@ -351,22 +351,23 @@
 reducer(
-expect
+undefin
 ed, %7B%7D))

fix test