{"size": 992, "ext": "js", "max_stars_repo_path": "test/unit/specs/post.spec.js", "max_stars_repo_name": "OakRaven/vue-spa-from-scratch", "max_stars_repo_stars_event_min_datetime": null, "max_stars_repo_stars_event_max_datetime": null, "max_issues_repo_path": "test/unit/specs/post.spec.js", "max_issues_repo_name": "OakRaven/vue-spa-from-scratch", "max_issues_repo_issues_event_min_datetime": null, "max_issues_repo_issues_event_max_datetime": null, "max_forks_repo_path": "test/unit/specs/post.spec.js", "max_forks_repo_name": "OakRaven/vue-spa-from-scratch", "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": 24.8, "max_line_length": 73, "alphanum_fraction": 0.595766129}
import Vue from 'vue'
import Post from '../../../src/theme/Post.vue'

describe('Post.vue', () => {
  const createComponet = () => {
    const PostContructor = Vue.extend(Post)
    const comp = new PostContructor({
      propsData: {
        link: 'http://www.pluralsight.com'
      }
    }).$mount()

    return comp
  }

  it('should render the link', () => {
    const comp = createComponet()
    expect(
      comp.$el.querySelector('.card-footer-item').getAttribute('href')
    ).to.equal('http://www.pluralsight.com')
  })

  it("should update element's href when properly link changes", done => {
    const comp = createComponet()

    expect(
      comp.$el.querySelector('.card-footer-item').getAttribute('href')
    ).to.equal('http://www.pluralsight.com')

    comp.link = 'http://www.nicomit.com'
    Vue.nextTick(() => {
      expect(
        comp.$el.querySelector('.card-footer-item').getAttribute('href')
      ).to.equal('http://www.nicomit.com')

      done()
    })
  })
})
