import { mount } from '@vue/test-utils'; import moment from 'moment'; 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'; const CommentTest = { data() { return { comments: [], submitting: false, value: '', moment, }; }, 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: moment().fromNow(), }, ...this.comments, ]; this.value = ''; }, 1000); }, handleChange(e) { this.value = e.target.value; }, }, render() { return (