<commit_before>import test from "ava"

import { stub } from "sinon"
import { clone } from "ramda"

import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

import player from "~/client/store/player"

test("beginning state: neither waiting nor playing", t => {
  const store = new Vuex.Store(clone(player))

  t.false(store.state.waiting)
  t.false(store.state.playing)
})

test("waiting mutation: sets waiting to true", t => {
  const store = new Vuex.Store(clone(player))

  store.commit("waiting")

  t.true(store.state.waiting)
})

test("moveable getter", t => {
  const kibitzerStore = new Vuex.Store(clone(kibitzer))
  kibitzerStore.commit("game", { role: PRIMARY, game: {
    currentPosition: { fen: STARTING_POSITION }
  } })

  const store = clone(player)
  const moveable = store.getters["moveable"](null, null, null, kibitzerStore.getters)
<commit_msg>fix missing imports<commit_after>import test from "ava"

import { stub } from "sinon"
import { clone } from "ramda"

import Vue from "vue"
import Vuex from "vuex"

Vue.use(Vuex)

import { STARTING_POSITION } from "~/share/constants/chess"
import { PRIMARY } from "~/share/constants/role"

import kibitzer from "~/client/store/kibitzer"
import player from "~/client/store/player"

test("beginning state: neither waiting nor playing", t => {
  const store = new Vuex.Store(clone(player))

  t.false(store.state.waiting)
  t.false(store.state.playing)
})

test("waiting mutation: sets waiting to true", t => {
  const store = new Vuex.Store(clone(player))

  store.commit("waiting")

  t.true(store.state.waiting)
})

test("moveable getter", t => {
  const kibitzerStore = new Vuex.Store(clone(kibitzer))
  kibitzerStore.commit("game", { role: PRIMARY, game: {
    currentPosition: { fen: STARTING_POSITION }
  } })

  const store = clone(player)
  const moveable = store.getters["moveable"](null, null, null, kibitzerStore.getters)

{'fraction_non_alphanumeric': 0.14127569847127042, 'fraction_numerical': 0.0, 'mean_word_length': 4.632047477744807, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 9, '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': '4532431', 'n_tokens_mistral': 683, 'n_tokens_neox': 661, 'n_words': 162}