diff --git a/README.md b/README.md index 6b89e10..f0853d8 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ Easy @mention, #hashtag and URL highlight for Vue 2.x ## Installation + You can install via npm or yarn: ```shell @@ -48,6 +49,7 @@ export default { } ``` + As you can see, the component accepts some props: | Prop | Type | Description | diff --git a/tests/unit/basic.spec.js b/tests/unit/basic.spec.js new file mode 100644 index 0000000..19531c2 --- /dev/null +++ b/tests/unit/basic.spec.js @@ -0,0 +1,23 @@ +import { mount, shallowMount } from '@vue/test-utils' +import App from '../../docs-src/App.vue' +import Docs from '../../docs-src/Docs.vue' + +describe('App.vue', () => { + it('renders Home page', () => { + const msg = 'vue-highlights' + const wrapper = mount(App, { + stubs: ['router-link', 'router-view'] + }) + expect(wrapper.text()).toMatch(msg) + }) +}) + +describe('Docs.vue', () => { + it('renders Docs page', () => { + const msg = 'Documentation' + const wrapper = shallowMount(Docs, { + stubs: ['router-link'] + }) + expect(wrapper.text()).toMatch(msg) + }) +}) diff --git a/tests/unit/example.spec.js b/tests/unit/example.spec.js deleted file mode 100644 index f84fb39..0000000 --- a/tests/unit/example.spec.js +++ /dev/null @@ -1,12 +0,0 @@ -import { shallowMount } from '@vue/test-utils' -import HelloWorld from '@/components/HelloWorld.vue' - -describe('HelloWorld.vue', () => { - it('renders props.msg when passed', () => { - const msg = 'new message' - const wrapper = shallowMount(HelloWorld, { - propsData: { msg } - }) - expect(wrapper.text()).toMatch(msg) - }) -})