<commit_before>/**
 * import(s)
 */

var Vue = require('../../node_modules/vue/dist/vue')
var plugin = require('../../index')


describe('minLength', function () {
  // TODO: 
  
  it('should be ok', function (done) {
    expect(true).to.be(true)
    done()
  })
})


describe('maxLength', function () {
  // TODO: 
  
  it('should be ok', function (done) {
    expect(true).to.be(true)
    done()
  })
})<commit_msg>Implement minLength/maxLength validator spec<commit_after>/**
 * import(s)
 */

var Vue = require('../../node_modules/vue/dist/vue')
var validator = require('../../index')
var createInstance = require('./helper').createInstance


describe('minLength', function () {
  var vm, target

  before(function () {
    Vue.config.async = false
    Vue.use(validator)
  })

  after(function () {
    Vue.config.async = true
  })
  
  beforeEach(function () {
    vm = createInstance(
      '<input type="text" v-model="comment" v-validate="minLength: 4">',
      { msg: null }
    )
    target = vm._children[0]
  })


  describe('when input 3 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaa'
      vm._digest() // force update
    })

    it('should be true', function () {
      expect(target.validation.comment.minLength).to.be(true)
    })
  })


  describe('when input 4 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaaa'
      vm._digest() // force update
    })

    it('should be false', function () {
      expect(target.validation.comment.minLength).to.be(false)
    })
  })


  describe('when input 5 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaaaa'
      vm._digest() // force update
    })

    it('should be false', function () {
      expect(target.validation.comment.minLength).to.be(false)
    })
  })
})



describe('maxLength', function () {
  var vm, target

  before(function () {
    Vue.config.async = false
    Vue.use(validator)
  })

  after(function () {
    Vue.config.async = true
  })
  
  beforeEach(function () {
    vm = createInstance(
      '<input type="text" v-model="comment" v-validate="maxLength: 4">',
      { msg: null }
    )
    target = vm._children[0]
  })


  describe('when input 3 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaa'
      vm._digest() // force update
    })

    it('should be false', function () {
      expect(target.validation.comment.maxLength).to.be(false)
    })
  })


  describe('when input 4 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaaa'
      vm._digest() // force update
    })

    it('should be false', function () {
      expect(target.validation.comment.maxLength).to.be(false)
    })
  })


  describe('when input 5 length string', function () {
    beforeEach(function () {
      vm.comment = 'aaaaa'
      vm._digest() // force update
    })

    it('should be true', function () {
      expect(target.validation.comment.maxLength).to.be(true)
    })
  })
})
{'fraction_non_alphanumeric': 0.17145688800792863, 'fraction_numerical': 0.003303600925008259, 'mean_word_length': 2.609058402860548, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '3702121', 'n_tokens_mistral': 994, 'n_tokens_neox': 949, 'n_words': 192}