<commit_before><commit_msg>add tests for auth duck<commit_after>import {
  LOG_OUT, logOut,
  AUTH, auth,
} from '../auth'

import reducer from '../auth'
import initialState from 'vclub/redux/initialClubState'

// action creator
test('logOut action creator creates proper action', () => {
  const nextRoom = 'CHAT'
  const expectedAction = {
    type: LOG_OUT,
    meta: {
      sideEffect: () => {}
    },
  }
  const action = logOut()
  expect(action.type).toEqual(expectedAction.type)

  const ioSocket = {
    emit: jest.fn(),
  };

  action.meta.sideEffect({ ioSocket })

  expect(ioSocket.emit).toHaveBeenCalledWith('logOut')
  expect(ioSocket.emit).toHaveBeenCalledTimes(1)
})

// reducer
test('reducer returns initial state', () => {
  const { auth: authInitialState } = initialState
  expect(reducer(undefined, {}))
    .toEqual(authInitialState)
})
{'fraction_non_alphanumeric': 0.1445221445221445, 'fraction_numerical': 0.0011655011655011655, 'mean_word_length': 3.994186046511628, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 6, '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': '224982', 'n_tokens_mistral': 277, 'n_tokens_neox': 276, 'n_words': 59}