tests: add additional components tests
This commit is contained in:
@@ -0,0 +1,9 @@
|
||||
<script setup>
|
||||
import { Background, VueFlow } from '@braks/vue-flow'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VueFlow>
|
||||
<Background />
|
||||
</VueFlow>
|
||||
</template>
|
||||
@@ -0,0 +1,18 @@
|
||||
import App from './App.vue'
|
||||
|
||||
describe('Render Background', () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(App, {
|
||||
attrs: {
|
||||
style: {
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('renders background', () => {
|
||||
cy.get('.vue-flow__background').should('exist')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,9 @@
|
||||
<script setup>
|
||||
import { Controls, VueFlow } from '@braks/vue-flow'
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VueFlow>
|
||||
<Controls />
|
||||
</VueFlow>
|
||||
</template>
|
||||
@@ -0,0 +1,18 @@
|
||||
import App from './App.vue'
|
||||
|
||||
describe('Render Controls', () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(App, {
|
||||
attrs: {
|
||||
style: {
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('renders controls', () => {
|
||||
cy.get('.vue-flow__controls').should('exist')
|
||||
})
|
||||
})
|
||||
@@ -0,0 +1,20 @@
|
||||
<script setup>
|
||||
import { MiniMap, VueFlow } from '@braks/vue-flow'
|
||||
|
||||
defineProps({
|
||||
nodes: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
edges: {
|
||||
type: Array,
|
||||
default: () => [],
|
||||
},
|
||||
})
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<VueFlow :nodes="nodes" :edges="edges">
|
||||
<MiniMap />
|
||||
</VueFlow>
|
||||
</template>
|
||||
@@ -0,0 +1,29 @@
|
||||
import { getElements } from '../../../utils'
|
||||
import App from './App.vue'
|
||||
|
||||
const { nodes, edges } = getElements()
|
||||
|
||||
describe('Render MiniMap', () => {
|
||||
beforeEach(() => {
|
||||
cy.mount(App, {
|
||||
props: {
|
||||
nodes,
|
||||
edges,
|
||||
},
|
||||
attrs: {
|
||||
style: {
|
||||
width: '100vw',
|
||||
height: '100vh',
|
||||
},
|
||||
},
|
||||
})
|
||||
})
|
||||
|
||||
it('renders minimap', () => {
|
||||
cy.get('.vue-flow__minimap').should('exist')
|
||||
})
|
||||
|
||||
it('renders minimap nodes', () => {
|
||||
cy.get('.vue-flow__minimap-node').should('have.length', nodes.length)
|
||||
})
|
||||
})
|
||||
@@ -10,6 +10,7 @@
|
||||
"@braks/vue-flow": "workspace:*"
|
||||
},
|
||||
"devDependencies": {
|
||||
"cypress": "^10.9.0"
|
||||
"cypress": "^10.9.0",
|
||||
"@vitejs/plugin-vue": "^2.3.4"
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
import { defineConfig } from 'vite'
|
||||
import vue from '@vitejs/plugin-vue'
|
||||
|
||||
export default defineConfig({
|
||||
plugins: [vue({ reactivityTransform: true })],
|
||||
server: {
|
||||
fs: {
|
||||
strict: false,
|
||||
|
||||
19
pnpm-lock.yaml
generated
19
pnpm-lock.yaml
generated
@@ -78,10 +78,12 @@ importers:
|
||||
e2e:
|
||||
specifiers:
|
||||
'@braks/vue-flow': workspace:*
|
||||
'@vitejs/plugin-vue': ^2.3.4
|
||||
cypress: ^10.9.0
|
||||
dependencies:
|
||||
'@braks/vue-flow': link:../packages/vue-flow
|
||||
devDependencies:
|
||||
'@vitejs/plugin-vue': 2.3.4_vite@2.9.15+vue@3.2.40
|
||||
cypress: 10.9.0
|
||||
|
||||
examples/nuxt3:
|
||||
@@ -2125,8 +2127,8 @@ packages:
|
||||
- supports-color
|
||||
dev: true
|
||||
|
||||
/@vitejs/plugin-vue/2.3.3_vite@2.9.14+vue@3.2.37:
|
||||
resolution: {integrity: sha512-SmQLDyhz+6lGJhPELsBdzXGc+AcaT8stgkbiTFGpXPe8Tl1tJaBw1A6pxDqDuRsVkD8uscrkx3hA7QDOoKYtyw==}
|
||||
/@vitejs/plugin-vue/2.3.4_vite@2.9.14+vue@3.2.37:
|
||||
resolution: {integrity: sha512-IfFNbtkbIm36O9KB8QodlwwYvTEsJb4Lll4c2IwB3VHc2gie2mSPtSzL0eYay7X2jd/2WX02FjSGTWR6OPr/zg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
peerDependencies:
|
||||
vite: ^2.5.10
|
||||
@@ -2147,6 +2149,17 @@ packages:
|
||||
vue: 3.2.37
|
||||
dev: true
|
||||
|
||||
/@vitejs/plugin-vue/2.3.4_vite@2.9.15+vue@3.2.40:
|
||||
resolution: {integrity: sha512-IfFNbtkbIm36O9KB8QodlwwYvTEsJb4Lll4c2IwB3VHc2gie2mSPtSzL0eYay7X2jd/2WX02FjSGTWR6OPr/zg==}
|
||||
engines: {node: '>=12.0.0'}
|
||||
peerDependencies:
|
||||
vite: ^2.5.10
|
||||
vue: ^3.2.25
|
||||
dependencies:
|
||||
vite: 2.9.15
|
||||
vue: 3.2.40
|
||||
dev: true
|
||||
|
||||
/@vitejs/plugin-vue/3.1.2_vite@3.1.6+vue@3.2.40:
|
||||
resolution: {integrity: sha512-3zxKNlvA3oNaKDYX0NBclgxTQ1xaFdL7PzwF6zj9tGFziKwmBa3Q/6XcJQxudlT81WxDjEhHmevvIC4Orc1LhQ==}
|
||||
engines: {node: ^14.18.0 || >=16.0.0}
|
||||
@@ -11149,7 +11162,7 @@ packages:
|
||||
dependencies:
|
||||
'@docsearch/css': 3.1.1
|
||||
'@docsearch/js': 3.1.1_imvgwgjzmeisgkq5uchhrryg6y
|
||||
'@vitejs/plugin-vue': 2.3.3_vite@2.9.14+vue@3.2.37
|
||||
'@vitejs/plugin-vue': 2.3.4_vite@2.9.14+vue@3.2.37
|
||||
'@vue/devtools-api': 6.2.1
|
||||
'@vueuse/core': 8.9.4_vue@3.2.37
|
||||
body-scroll-lock: 4.0.0-beta.0
|
||||
|
||||
Reference in New Issue
Block a user