<commit_before>/* @flow */
'use strict'

import { describe, it } from 'mocha'
import expect from 'expect'

import { fromJS } from 'immutable'

import reducer, { initialState } from '../../../../app/js/reducers/filter-component-state'

import { SET_FILTER_COMPONENT_OPEN_STATUS } from '../../../../app/js/actions'

describe('Filter Component Reducer', () => {
  describe('common', () => {
    it('should have initial state', () => {

      const action = {
        type: 'UNKNOWN',
      }

      const newState = reducer(undefined, action)

      expect(newState).toEqual(initialState)
    })

    it('should be immutable', () => {
      const state = initialState

      const action = {
        type: 'UNKNOWN',
      }

      reducer(state, action)

      expect(state).toBe(state)
    })
  })

  describe('#SET_FILTER_COMPONENT_OPEN_STATUS', () => {
    it.only('should set state to true', () => {
      const state = initialState

      const action = {
        type: SET_FILTER_COMPONENT_OPEN_STATUS,
        payload: true,
      }

      const newState = reducer(state, action)

      expect(newState).toEqual(fromJS({
        open: true,
        selectedFilterMenu: 'root',
      }))

    })

    it('should set state to false', () => {

    })<commit_msg>test(filterComponent reducer): sets open status to false<commit_after>/* @flow */
'use strict'

import { describe, it } from 'mocha'
import expect from 'expect'

import { fromJS } from 'immutable'

import reducer, { initialState } from '../../../../app/js/reducers/filter-component-state'

import { SET_FILTER_COMPONENT_OPEN_STATUS } from '../../../../app/js/actions'

describe('Filter Component Reducer', () => {
  describe('common', () => {
    it('should have initial state', () => {

      const action = {
        type: 'UNKNOWN',
      }

      const newState = reducer(undefined, action)

      expect(newState).toEqual(initialState)
    })

    it('should be immutable', () => {
      const state = initialState

      const action = {
        type: 'UNKNOWN',
      }

      reducer(state, action)

      expect(state).toBe(state)
    })
  })

  describe('#SET_FILTER_COMPONENT_OPEN_STATUS', () => {
    it('should set state to true', () => {
      const state = initialState

      const action = {
        type: SET_FILTER_COMPONENT_OPEN_STATUS,
        payload: true,
      }

      const newState = reducer(state, action)

      expect(newState).toEqual(fromJS({
        open: true,
        selectedFilterMenu: 'root',
      }))
    })

    it.only('should set state to false', () => {
      const state = initialState

      const action = {
        type: SET_FILTER_COMPONENT_OPEN_STATUS,
        payload: false,
      }

      const newState = reducer(state, action)

      expect(newState).toEqual(fromJS({
        open: false,
        selectedFilterMenu: 'root',
      }))
    })
{'fraction_non_alphanumeric': 0.14680181754631247, 'fraction_numerical': 0.0, 'mean_word_length': 2.444043321299639, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 17, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5316520', 'n_tokens_mistral': 875, 'n_tokens_neox': 849, 'n_words': 194}