https://cypress.io logo
#vue
Title
# vue
b

better-piano-6669

11/25/2021, 6:50 AM
Then it says 'h is not defined'
b

bored-nightfall-61392

11/25/2021, 8:49 AM
Print here the code of your component
b

better-piano-6669

11/26/2021, 7:05 AM
Sorry for my late response. I have tried a few things and now its says: "React is not defined"
Here is my component: >
Copy code
<script setup>
> import { useAuthStore } from '@/store'
> </script>
> 
> <template>
>   <el-form>
>     <el-form-item label="Username">
>       <el-input />
>     </el-form-item>
>     <el-form-item label="Password">
>       <el-input placeholder="Please input password" show-password />
>     </el-form-item>
>     <el-form-item>
>       <el-button type="primary" @click="">Login</el-button>
>     </el-form-item>
>   </el-form>
> </template>
import { mount } from '@cypress/vue' import Login from './Login.vue' describe('', () => { it('renders', () => { cy.viewport(1280, 720) mount() }) })
and thats the test
this is working:
Copy code
import { mount } from '@cypress/vue'
import Login from './Login.vue'

describe('<Login />', () => {
  it('renders', () => {
    cy.viewport(1280, 720)
    mount(Login)
  })
})
b

bored-nightfall-61392

11/29/2021, 2:47 PM
Do you use vite ? Is your file with extension
.jsx
?
b

better-piano-6669

11/30/2021, 7:18 AM
I think the problem is vue 2 with composition API. In my vue 3 projects is it working fine.
6 Views