<commit_before>import { expect } from 'chai'
import Ember from 'ember'
const { run } = Ember
import { describeComponent } from 'ember-mocha'
import PropTypeMixin from 'ember-prop-types'
import { beforeEach, describe, it } from 'mocha'

describeComponent(
  'frost-pagination',
  'Unit: FrostPaginationComponent',
  {
    unit: true
  },
  function () {
    let component

    beforeEach(function () {
      component = this.subject()
    })

    it('includes className frost-pagination', function () {
      expect(component.classNames).to.include('frost-pagination')
    })

    describe('dependent keys', function () {
      let _endDependentKeys,
        _isLeftDisabledDependentKeys,
        _isRightDisabledDependentKeys,
        _offsetDependentKeys,
        _paginationTextDependentKeys

      beforeEach(function () {
        _endDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _isLeftDisabledDependentKeys = [
          'page'
        ]

        _isRightDisabledDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _offsetDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _paginationTextDependentKeys = [
          '_offset',
          '_end',
          'total'
        ]
      })

      it('sets correct dependent keys for _end computed property', function () {
        expect(
          component._end._dependentKeys,
        ).to.eql(_endDependentKeys)
      })

      it('sets correct dependent keys for _isLeftDisabled computed property', function () {
        expect(
          component._isLeftDisabled._dependentKeys,
        ).to.eql(_isLeftDisabledDependentKeys)
      })

      it('sets correct dependent keys for _isRightDisabled computed property', function () {
        expect(
          component._isRightDisabled._dependentKeys,
        ).to.eql(_isRightDisabledDependentKeys)
      })

      it('sets correct dependent keys for _offset computed property', function () {
        expect(
          component._offset._dependentKeys,
        ).to.eql(_offsetDependentKeys)
      })

      it('sets correct dependent keys for _paginationText computed property', function () {
        expect(
          component._paginationText._dependentKeys,
        ).to.eql(_paginationTextDependentKeys)
      })
    })

    it('has the expected Mixins', function () {
      expect(
        PropTypeMixin.detect(component),
        'PropTypeMixin Mixin is present'
      ).to.eql(true)
    })

    describe('_end computed property', function () {
      it('is set to pageMax when it is NOT at the last page', function () {
        run(() => {
          component.set('itemsPerPage', 10)
          component.set('page', 5)
          component.set('total', 100)
        })

        const expectedPageMax = (component.get('page') + 1) * component.get('itemsPerPage')

        expect(
          component.get('_end'),
        ).to.eql(expectedPageMax)
      })

      it('is set to total when it is at the last page', function () {
        run(() => {
          component.set('itemsPerPage', 10)
          component.set('page', 9)
          component.set('total', 100)
        })

        const total = component.get('total')

        expect(
          component.get('_end'),
        ).to.eql(total)
      })
    })

    describe('_isLeftDisabled computed property', function () {
      it('is set to true when it is at the first page', function () {
        run(() => component.set('page', 0))

        expect(
          component.get('_isLeftDisabled'),
        ).to.eql(true)
      })

      it('is set to false when it is NOT at the first page', function () {
        run(() => component.set('page', 5))

        expect(
          component.get('_isLeftDisabled'),
        ).to.eql(false)
      })
    })

    describe('_isRightDisabled computed property', function () {
      it('is set to true when total is equal to 0', function () {
        run(() => component.set('total', 0))<commit_msg>updated test descriptions<commit_after>import { expect } from 'chai'
import Ember from 'ember'
const { run } = Ember
import { describeComponent } from 'ember-mocha'
import PropTypeMixin from 'ember-prop-types'
import { beforeEach, describe, it } from 'mocha'

describeComponent(
  'frost-pagination',
  'Unit: FrostPaginationComponent',
  {
    unit: true
  },
  function () {
    let component

    beforeEach(function () {
      component = this.subject()
    })

    it('includes className frost-pagination', function () {
      expect(component.classNames).to.include('frost-pagination')
    })

    describe('dependent keys', function () {
      let _endDependentKeys,
        _isLeftDisabledDependentKeys,
        _isRightDisabledDependentKeys,
        _offsetDependentKeys,
        _paginationTextDependentKeys

      beforeEach(function () {
        _endDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _isLeftDisabledDependentKeys = [
          'page'
        ]

        _isRightDisabledDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _offsetDependentKeys = [
          'itemsPerPage',
          'page',
          'total'
        ]

        _paginationTextDependentKeys = [
          '_offset',
          '_end',
          'total'
        ]
      })

      it('sets correct dependent keys for _end computed property', function () {
        expect(
          component._end._dependentKeys,
        ).to.eql(_endDependentKeys)
      })

      it('sets correct dependent keys for _isLeftDisabled computed property', function () {
        expect(
          component._isLeftDisabled._dependentKeys,
        ).to.eql(_isLeftDisabledDependentKeys)
      })

      it('sets correct dependent keys for _isRightDisabled computed property', function () {
        expect(
          component._isRightDisabled._dependentKeys,
        ).to.eql(_isRightDisabledDependentKeys)
      })

      it('sets correct dependent keys for _offset computed property', function () {
        expect(
          component._offset._dependentKeys,
        ).to.eql(_offsetDependentKeys)
      })

      it('sets correct dependent keys for _paginationText computed property', function () {
        expect(
          component._paginationText._dependentKeys,
        ).to.eql(_paginationTextDependentKeys)
      })
    })

    it('has the expected Mixins', function () {
      expect(
        PropTypeMixin.detect(component),
        'PropTypeMixin Mixin is present'
      ).to.eql(true)
    })

    describe('_end computed property', function () {
      it('is set to pageMax NOT at the last page', function () {
        run(() => {
          component.set('itemsPerPage', 10)
          component.set('page', 5)
          component.set('total', 100)
        })

        const expectedPageMax = (component.get('page') + 1) * component.get('itemsPerPage')

        expect(
          component.get('_end'),
        ).to.eql(expectedPageMax)
      })

      it('is set to total at the last page', function () {
        run(() => {
          component.set('itemsPerPage', 10)
          component.set('page', 9)
          component.set('total', 100)
        })

        const total = component.get('total')

        expect(
          component.get('_end'),
        ).to.eql(total)
      })
    })

    describe('_isLeftDisabled computed property', function () {
      it('is set to true at the first page', function () {
        run(() => component.set('page', 0))

        expect(
          component.get('_isLeftDisabled'),
        ).to.eql(true)
      })

      it('is set to false NOT at the first page', function () {
        run(() => component.set('page', 5))

        expect(
          component.get('_isLeftDisabled'),
        ).to.eql(false)
      })
    })

    describe('_isRightDisabled computed property', function () {
      it('is set to true when total is equal to 0', function () {
        run(() => component.set('total', 0))
{'fraction_non_alphanumeric': 0.11833291987099975, 'fraction_numerical': 0.0042173158025303895, 'mean_word_length': 2.150840171942165, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 13, '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': '3512735', 'n_tokens_mistral': 2271, 'n_tokens_neox': 2178, 'n_words': 505}