fix: use two words component name
This commit is contained in:
parent
2e425e13bd
commit
01e0cbbb82
6
src/components.d.ts
vendored
6
src/components.d.ts
vendored
@ -7,11 +7,11 @@ export {}
|
|||||||
|
|
||||||
declare module '@vue/runtime-core' {
|
declare module '@vue/runtime-core' {
|
||||||
export interface GlobalComponents {
|
export interface GlobalComponents {
|
||||||
Counter: typeof import('./components/Counter.vue')['default']
|
|
||||||
Footer: typeof import('./components/Footer.vue')['default']
|
|
||||||
Input: typeof import('./components/Input.vue')['default']
|
|
||||||
README: typeof import('./components/README.md')['default']
|
README: typeof import('./components/README.md')['default']
|
||||||
RouterLink: typeof import('vue-router')['RouterLink']
|
RouterLink: typeof import('vue-router')['RouterLink']
|
||||||
RouterView: typeof import('vue-router')['RouterView']
|
RouterView: typeof import('vue-router')['RouterView']
|
||||||
|
TheCounter: typeof import('./components/TheCounter.vue')['default']
|
||||||
|
TheFooter: typeof import('./components/TheFooter.vue')['default']
|
||||||
|
TheInput: typeof import('./components/TheInput.vue')['default']
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
|
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<Footer />
|
<TheFooter />
|
||||||
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
|
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
|
||||||
[Default Layout]
|
[Default Layout]
|
||||||
</div>
|
</div>
|
||||||
|
@ -1,7 +1,7 @@
|
|||||||
<template>
|
<template>
|
||||||
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
|
<main class="px-4 py-10 text-center text-gray-700 dark:text-gray-200">
|
||||||
<RouterView />
|
<RouterView />
|
||||||
<Footer />
|
<TheFooter />
|
||||||
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
|
<div class="mt-5 mx-auto text-center opacity-75 dark:opacity-50 text-sm">
|
||||||
[Home Layout]
|
[Home Layout]
|
||||||
</div>
|
</div>
|
||||||
|
@ -27,9 +27,9 @@ watchEffect(() => {
|
|||||||
<span opacity-75>{{ t('intro.aka') }}:</span>
|
<span opacity-75>{{ t('intro.aka') }}:</span>
|
||||||
<ul>
|
<ul>
|
||||||
<li v-for="otherName in user.otherNames" :key="otherName">
|
<li v-for="otherName in user.otherNames" :key="otherName">
|
||||||
<router-link :to="`/hi/${otherName}`" replace>
|
<RouterLink :to="`/hi/${otherName}`" replace>
|
||||||
{{ otherName }}
|
{{ otherName }}
|
||||||
</router-link>
|
</RouterLink>
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</p>
|
</p>
|
||||||
|
@ -30,7 +30,7 @@ const { t } = useI18n()
|
|||||||
|
|
||||||
<div py-4 />
|
<div py-4 />
|
||||||
|
|
||||||
<Input
|
<TheInput
|
||||||
v-model="name"
|
v-model="name"
|
||||||
placeholder="What's your name?"
|
placeholder="What's your name?"
|
||||||
autocomplete="false"
|
autocomplete="false"
|
||||||
|
@ -1,3 +1,3 @@
|
|||||||
// Vitest Snapshot v1
|
// Vitest Snapshot v1
|
||||||
|
|
||||||
exports[`Counter.vue > should render 1`] = `"<div>10 <button class=\\"inc\\"> + </button><button class=\\"dec\\"> - </button></div>"`;
|
exports[`TheCounter.vue > should render 1`] = `"<div>10 <button class=\\"inc\\"> + </button><button class=\\"dec\\"> - </button></div>"`;
|
||||||
|
@ -1,16 +1,16 @@
|
|||||||
import { mount } from '@vue/test-utils'
|
import { mount } from '@vue/test-utils'
|
||||||
import { describe, expect, it } from 'vitest'
|
import { describe, expect, it } from 'vitest'
|
||||||
import Counter from '../src/components/Counter.vue'
|
import TheCounter from '../src/components/TheCounter.vue'
|
||||||
|
|
||||||
describe('Counter.vue', () => {
|
describe('TheCounter.vue', () => {
|
||||||
it('should render', () => {
|
it('should render', () => {
|
||||||
const wrapper = mount(Counter, { props: { initial: 10 } })
|
const wrapper = mount(TheCounter, { props: { initial: 10 } })
|
||||||
expect(wrapper.text()).toContain('10')
|
expect(wrapper.text()).toContain('10')
|
||||||
expect(wrapper.html()).toMatchSnapshot()
|
expect(wrapper.html()).toMatchSnapshot()
|
||||||
})
|
})
|
||||||
|
|
||||||
it('should be interactive', async () => {
|
it('should be interactive', async () => {
|
||||||
const wrapper = mount(Counter, { props: { initial: 0 } })
|
const wrapper = mount(TheCounter, { props: { initial: 0 } })
|
||||||
expect(wrapper.text()).toContain('0')
|
expect(wrapper.text()).toContain('0')
|
||||||
|
|
||||||
expect(wrapper.find('.inc').exists()).toBe(true)
|
expect(wrapper.find('.inc').exists()).toBe(true)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user