Skip to content

Commit 7974b2e

Browse files
committed
feat: add tests in default templates
1 parent 0885ed8 commit 7974b2e

File tree

2 files changed

+44
-0
lines changed

2 files changed

+44
-0
lines changed
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { mount } from '@cypress/vue'
2+
import HelloWorld from '../HelloWorld.vue'
3+
4+
describe('HelloWorld', () => {
5+
it('playground', () => {
6+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
7+
})
8+
9+
it('renders properly', () => {
10+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
11+
cy.get('h1').should('contain', 'Hello Cypress')
12+
})
13+
14+
it('adds 1 when clicking the plus button', () => {
15+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
16+
17+
cy.get('button')
18+
.should('contain', '0')
19+
.click()
20+
.should('contain', '1')
21+
})
22+
})
Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
import { mount } from '@cypress/vue'
2+
import HelloWorld from '../HelloWorld.vue'
3+
4+
describe('HelloWorld', () => {
5+
it('playground', () => {
6+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
7+
})
8+
9+
it('renders properly', () => {
10+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
11+
cy.get('h1').should('contain', 'Hello Cypress')
12+
})
13+
14+
it('adds 1 when clicking the plus button', () => {
15+
mount(HelloWorld, { props: { msg: 'Hello Cypress' } })
16+
17+
cy.get('button')
18+
.should('contain', '0')
19+
.click()
20+
.should('contain', '1')
21+
})
22+
})

0 commit comments

Comments
 (0)