This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import Vue from 'vue' | |
import Router from 'vue-router' | |
import HelloWorld from '@/components/HelloWorld' | |
import ProfileView from '@/views/profile/Index' | |
import CreatePost from '@/views/posts/Create' | |
Vue.use(Router) | |
export default new Router({ | |
routes: [ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallow } from 'vue-test-utils' | |
import Create from './Create' | |
describe('Create', () => { | |
it('renders a Create Post title', () => { | |
const wrapper = shallow(Create) | |
expect(wrapper.find('.title').text()).toEqual('Create Post') | |
}) | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="title">Create Post</div> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'Create' | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<textarea | |
:value="value" | |
@input="handleInput" | |
/> | |
</div> | |
</template> | |
<script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import { shallow } from 'vue-test-utils' | |
import CreateDescription from './CreateDescription' | |
describe('CreateDescription', () => { | |
it('emits a input event with the entered value', () => { | |
const wrapper = shallow(CreateDescription, { | |
propsData: { | |
value: '' | |
} | |
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
{{ content }} | |
<CreatePost> | |
<CreateDescription | |
slot="description" | |
v-model="content" | |
/> | |
</CreatePost> | |
</div> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
Create Post Component | |
<slot name="description" /> | |
</div> | |
</template> | |
<script> | |
export default { | |
name: 'CreatePost' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
<div class="title">Create Post</div> | |
<CreatePostContainer /> | |
</div> | |
</template> | |
<script> | |
import CreatePostContainer from '@/components/posts/CreatePostContainer' | |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<template> | |
<div> | |
Create Post Component | |
<form @submit.prevent="$emit('submit')"> | |
<slot name="description" /> | |
<slot name="submit" /> | |
</form> | |
</div> | |
</template> |