<commit_before>import { expect } from 'chai'
import {
  beforeEach,
  describe,
  it
} from 'mocha'
import Ember from 'ember'
const {on} = Ember
import FrostListCoreMixin from 'ember-frost-list/mixins/frost-list-core-mixin'

describe('FrostListCoreMixin', function () {
  let controller
  let listConfig
  const testItems = [
    {
      id: 1
    },
    {
      id: 2
    }
  ]
  beforeEach(function () {
    listConfig = {
      items: 'model',
      component: 'user-list-item'
    }
    controller = Ember.Controller.extend(FrostListCoreMixin).create({
      initListCoreMixin: on('init', function () {
        Ember.defineProperty(this, listConfig.items, undefined, testItems)
        Ember.defineProperty(this, '_listItems', Ember.computed.alias(listConfig.items))
      })
    })
  })

  it('works', function () {
    let testObject = Ember.Object.extend(FrostListCoreMixin)
    let subject = testObject.create({
      initListCoreMixin: on('init', function () {
        Ember.defineProperty(this, '_listItems', Ember.computed.alias(listConfig.items))
      })
    })
    expect(
      subject
    ).to.be.ok
  })

  it('filteredItems computed property is correctly set', function () {
    // console.log(controller)
    // console.log(controller.model)
    // console.log(controller._listItems)
    // console.log(controller.get('listItems'))
    expect(
      controller.get('filteredItems'),
      'listConfig.item is identical to filteredItems'
    ).to.eql(testItems)
  })

  it('listItems computed property is correctly set', function () {
    expect(
      controller.get('listItems')[0].id,
      'listItems[0].id is set to 1'
    ).to.eql(1)
<commit_msg>clean up<commit_after>import { expect } from 'chai'
import {
  beforeEach,
  describe,
  it
} from 'mocha'
import Ember from 'ember'
const {on} = Ember
import FrostListCoreMixin from 'ember-frost-list/mixins/frost-list-core-mixin'

describe('FrostListCoreMixin', function () {
  let controller
  let listConfig
  const testItems = [
    {
      id: 1
    },
    {
      id: 2
    }
  ]
  beforeEach(function () {
    listConfig = {
      items: 'model',
      component: 'user-list-item'
    }
    controller = Ember.Controller.extend(FrostListCoreMixin).create({
      initListCoreMixin: on('init', function () {
        Ember.defineProperty(this, listConfig.items, undefined, testItems)
        Ember.defineProperty(this, '_listItems', Ember.computed.alias(listConfig.items))
      })
    })
  })

  it('works', function () {
    let testObject = Ember.Object.extend(FrostListCoreMixin)
    let subject = testObject.create({
      initListCoreMixin: on('init', function () {
        Ember.defineProperty(this, '_listItems', Ember.computed.alias(listConfig.items))
      })
    })
    expect(
      subject
    ).to.be.ok
  })

  it('filteredItems computed property is correctly set', function () {
    expect(
      controller.get('filteredItems'),
      'listConfig.item is identical to filteredItems'
    ).to.eql(testItems)
  })

  it('listItems computed property is correctly set', function () {
    expect(
      controller.get('listItems')[0].id,
      'listItems[0].id is set to 1'
    ).to.eql(1)

{'fraction_non_alphanumeric': 0.13377400062952471, 'fraction_numerical': 0.003777148253068933, 'mean_word_length': 3.007566204287516, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '6073694', 'n_tokens_mistral': 1036, 'n_tokens_neox': 1013, 'n_words': 201}