import { expect } from 'chai'
import types from '../../src/constants/actionTypes'
import { onClickMenuButton } from '../../src/actions/nav'

describe('actions/nav.js', () => {
  it('should toggle sidebar menu when click on menu button', () => {
    const isExpanded = false 
    
    expect(onClickMenuButton(isExpanded)).to.deep.equal({
      type: types.ON_CLICK_MENU_BUTTON,
      isExpanded: ! isExpanded
    })
  })
})
import { expect } from 'chai'
import types from '../../src/constants/actionTypes'
import { onClickMenuButton } from '../../src/actions/nav'

describe('actions/nav.js', () => {
  it('should toggle state "true" when click on menu button', () => {
    const isExpanded = false 
    
    expect(onClickMenuButton(isExpanded)).to.deep.equal({
      type: types.ON_CLICK_MENU_BUTTON,
      isExpanded: ! isExpanded
    })
  })
  
  it('should toggle state "false" when click on menu button', () => {
    const isExpanded = true 
    
    expect(onClickMenuButton(isExpanded)).to.deep.equal({
      type: types.ON_CLICK_MENU_BUTTON,
      isExpanded: ! isExpanded
    })
  })
})
Add toggle false on click menu button
Add toggle false on click menu button
