{"size": 788, "ext": "js", "max_stars_repo_path": "test/components/anchored-tag.spec.js", "max_stars_repo_name": "archco/cosmos-ui", "max_stars_repo_stars_event_min_datetime": "2018-02-19T13:32:35.000Z", "max_stars_repo_stars_event_max_datetime": "2019-02-28T10:53:43.000Z", "max_issues_repo_path": "test/components/anchored-tag.spec.js", "max_issues_repo_name": "archco/moss-ui", "max_issues_repo_issues_event_min_datetime": "2017-07-21T04:28:47.000Z", "max_issues_repo_issues_event_max_datetime": "2022-02-10T00:05:43.000Z", "max_forks_repo_path": "test/components/anchored-tag.spec.js", "max_forks_repo_name": "archco/cosmos-ui", "max_forks_repo_forks_event_min_datetime": "2018-06-24T02:08:09.000Z", "max_forks_repo_forks_event_max_datetime": "2019-07-15T09:05:17.000Z"}
{"max_stars_count": 2, "max_issues_count": 144, "max_forks_count": 2, "avg_line_length": 23.8787878788, "max_line_length": 70, "alphanum_fraction": 0.5355329949}
import { mount } from '@vue/test-utils';
import AnchoredTag from '../../src/js/components/anchored-tag.vue';

describe('#AnchoredTag', () => {
  it('set tag and text.', () => {
    const wrapper = mount(AnchoredTag, {
      propsData: {
        tag: 'h1',
        owned: true,
      },
      slots: {
        default: 'Hello',
      }
    });
    expect(wrapper.props().tag).toBe('h1');
    expect(wrapper.element.tagName).toBe('H1');
    expect(wrapper.element.textContent).toBe('Hello');
  });

  it('id will be kebab-case.', () => {
    const wrapper = mount(AnchoredTag, {
      propsData: {
        tag: 'h1',
        owned: true,
      },
      slots: {
        default: 'HelloWorld',
      }
    });
    expect(wrapper.element.getAttribute('id')).toEqual('hello-world');
  });
});
