import { mount } from '@vue/test-utils'; import dayjs from 'dayjs'; import { asyncExpect } from '../../../tests/utils'; import Comment from '..'; import List from '../../list'; import Form from '../../form'; import Button from '../../button'; import Input from '../../input'; import mountTest from '../../../tests/shared/mountTest'; import relativeTime from 'dayjs/plugin/relativeTime'; dayjs.extend(relativeTime); const CommentTest = { data() { return { comments: [], submitting: false, value: '', dayjs, }; }, methods: { handleSubmit() { if (!this.value) { return; } this.submitting = true; setTimeout(() => { this.submitting = false; this.comments = [ { author: 'Han Solo', avatar: 'https://zos.alipayobjects.com/rmsportal/ODTLcjxAfvqbxHnVXCYX.png', content: this.value, datetime: dayjs().fromNow(), }, ...this.comments, ]; this.value = ''; }, 1000); }, handleChange(e) { this.value = e.target.value; }, }, render() { return (