<commit_before>import Vue from 'vue'

describe('Directive v-show', () => {
  it('should check show value is truthy', () => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: true }
    })
    expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
  })

  it('should check show value is falsy', () => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: false }
    })
    expect(vm.$el.innerHTML).toBe('<span style="display: none;">hello</span>')
  })

  it('should update show value changed', done => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: true }
    })
    expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
    vm.foo = false
    waitForUpdate(() => {
      expect(vm.$el.innerHTML).toBe('<span style="display: none;">hello</span>')
      vm.foo = {}
    }).then(() => {
      expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
      vm.foo = 0
    }).then(() => {
      expect(vm.$el.innerHTML).toBe('<span style="display: none;">hello</span>')
      vm.foo = []
    }).then(() => {
      expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
      vm.foo = null
    }).then(() => {
      expect(vm.$el.innerHTML).toBe('<span style="display: none;">hello</span>')
      vm.foo = '0'
    }).then(() => {
      expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
      vm.foo = undefined
    }).then(() => {
      expect(vm.$el.innerHTML).toBe('<span style="display: none;">hello</span>')
      vm.foo = 1
    }).then(() => {
      expect(vm.$el.innerHTML).toMatch(/<span( style="")?>hello<\/span>/)
      done()
    }).catch(done)
  })
})
<commit_msg>use more reliable display check for v-show tests (fix it in PhantomJS)<commit_after>import Vue from 'vue'

describe('Directive v-show', () => {
  it('should check show value is truthy', () => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: true }
    })
    expect(vm.$el.firstChild.style.display).toBe('')
  })

  it('should check show value is falsy', () => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: false }
    })
    expect(vm.$el.firstChild.style.display).toBe('none')
  })

  it('should update show value changed', done => {
    const vm = new Vue({
      el: '#app',
      template: '<div><span v-show="foo">hello</span></div>',
      data: { foo: true }
    })
    expect(vm.$el.firstChild.style.display).toBe('')
    vm.foo = false
    waitForUpdate(() => {
      expect(vm.$el.firstChild.style.display).toBe('none')
      vm.foo = {}
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('')
      vm.foo = 0
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('none')
      vm.foo = []
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('')
      vm.foo = null
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('none')
      vm.foo = '0'
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('')
      vm.foo = undefined
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('none')
      vm.foo = 1
    }).then(() => {
      expect(vm.$el.firstChild.style.display).toBe('')
      done()
    }).catch(done)
  })
})

{'fraction_non_alphanumeric': 0.23870967741935484, 'fraction_numerical': 0.0016830294530154279, 'mean_word_length': 2.653688524590164, 'pattern_counts': {'":': 0, '<': 49, '<?xml version=': 0, '>': 73, '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': '2639225', 'n_tokens_mistral': 1219, 'n_tokens_neox': 1209, 'n_words': 217}