{"size": 1688, "ext": "js", "max_stars_repo_path": "test/tabs.test.js", "max_stars_repo_name": "Ysom/yvue-ui", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/tabs.test.js", "max_issues_repo_name": "Ysom/yvue-ui", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/tabs.test.js", "max_forks_repo_name": "Ysom/yvue-ui", "max_forks_repo_forks_event_min_datetime": null, "max_forks_repo_forks_event_max_datetime": null}
{"max_stars_count": null, "max_issues_count": null, "max_forks_count": null, "avg_line_length": 31.8490566038, "max_line_length": 81, "alphanum_fraction": 0.6013033175}
const expect = chai.expect

import Vue from 'vue'
import Tabs from '../src/components/tabs/Tabs'
import TabsHead from '../src/components/tabs/TabsHead.vue'
import TabsBody from '../src/components/tabs/TabsBody.vue'
import TabsItem from '../src/components/tabs/TabsItem.vue'
import TabsPane from '../src/components/tabs/TabsPane.vue'

Vue.component('yv-tabs', Tabs)
Vue.component('yv-tabs-head', TabsHead)
Vue.component('yv-tabs-body', TabsBody)
Vue.component('yv-tabs-item', TabsItem)
Vue.component('yv-tabs-pane', TabsPane)

Vue.config.productionTip = false
Vue.config.devtools = false

describe('Tabs', () => {
  it('tabs存在.', () => {
    expect(Tabs).to.be.ok
  })
  describe('props',() => {
    it('可以接受 selected',(done) => {
      const div = document.createElement('div')
      document.body.appendChild(div)
      div.innerHTML = `
        <yv-tabs selected="tab1">
          <yv-tabs-head>
            <yv-tabs-item name="tab1" >tab1</yv-tabs-item>
            <yv-tabs-item name="tab2">tab2</yv-tabs-item>
            <yv-tabs-item name="tab3">tab3</yv-tabs-item>
          </yv-tabs-head>
          <yv-tabs-body>
            <yv-tabs-pane name="tab1">content1</yv-tabs-pane>
            <yv-tabs-pane name="tab2">content2</yv-tabs-pane>
            <yv-tabs-pane name="tab3">content3</yv-tabs-pane>
          </yv-tabs-body>
        </yv-tabs-body>
      `
      let vm = new Vue({
        el: div
      })
      vm.$nextTick(()=>{
        let currentItem = vm.$el.querySelector(`.yv-tabs-item[data-name='tab1']`)
        expect(currentItem.classList.contains('current-tabs-item')).to.be.true
        done()
        vm.$el.remove()
        vm.$destroy()
      })
    })
  })
})