mirror of
https://github.com/Ocelot-Social-Community/Ocelot-Social.git
synced 2025-12-13 07:46:06 +00:00
Follow file naming convention
All components should consist of a folder with these three files: ``` README.d index.vue spec.js ``` When you import components, omit the `index.vue`. That helps to `git grep` for component names.
This commit is contained in:
parent
f760f37186
commit
b70e5be8b1
@ -49,7 +49,7 @@
|
|||||||
|
|
||||||
<script>
|
<script>
|
||||||
import gql from 'graphql-tag'
|
import gql from 'graphql-tag'
|
||||||
import HcEditor from '~/components/Editor/Editor.vue'
|
import HcEditor from '~/components/Editor'
|
||||||
|
|
||||||
export default {
|
export default {
|
||||||
components: {
|
components: {
|
||||||
|
|||||||
@ -1,14 +0,0 @@
|
|||||||
import { shallowMount } from '@vue/test-utils'
|
|
||||||
import Editor from './Editor.vue'
|
|
||||||
|
|
||||||
describe('Editor.vue', () => {
|
|
||||||
let wrapper
|
|
||||||
|
|
||||||
beforeEach(() => {
|
|
||||||
wrapper = shallowMount(Editor, {})
|
|
||||||
})
|
|
||||||
|
|
||||||
it('renders', () => {
|
|
||||||
expect(wrapper.is('div')).toBe(true)
|
|
||||||
})
|
|
||||||
})
|
|
||||||
44
webapp/components/Editor/spec.js
Normal file
44
webapp/components/Editor/spec.js
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
import { mount, createLocalVue } from '@vue/test-utils'
|
||||||
|
import Editor from './'
|
||||||
|
|
||||||
|
import Styleguide from '@human-connection/styleguide'
|
||||||
|
|
||||||
|
const localVue = createLocalVue()
|
||||||
|
localVue.use(Styleguide)
|
||||||
|
|
||||||
|
describe('Editor.vue', () => {
|
||||||
|
let wrapper
|
||||||
|
let propsData
|
||||||
|
|
||||||
|
beforeEach(() => {
|
||||||
|
propsData = {}
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('mount', () => {
|
||||||
|
let Wrapper = () => {
|
||||||
|
return (wrapper = mount(Editor, {
|
||||||
|
propsData,
|
||||||
|
localVue,
|
||||||
|
sync: false,
|
||||||
|
stubs: { transition: false }
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
|
it('renders', () => {
|
||||||
|
expect(Wrapper().is('div')).toBe(true)
|
||||||
|
})
|
||||||
|
|
||||||
|
describe('given a piece of text', () => {
|
||||||
|
beforeEach(() => {
|
||||||
|
propsData.value = 'I am a piece of text'
|
||||||
|
})
|
||||||
|
|
||||||
|
it.skip('renders', () => {
|
||||||
|
wrapper = Wrapper()
|
||||||
|
expect(wrapper.find('.ProseMirror').text()).toContain(
|
||||||
|
'I am a piece of text'
|
||||||
|
)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
|
})
|
||||||
Loading…
x
Reference in New Issue
Block a user