forked from cypress-io/cypress-vue-unit-test
-
Notifications
You must be signed in to change notification settings - Fork 0
/
options-spec.js
65 lines (51 loc) · 1.27 KB
/
options-spec.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
const mountVue = require('../..')
const template = `
<div id="app">
{{ message }}
</div>
`
const data = {
message: 'Hello Vue!'
}
/* eslint-env mocha */
describe('Pass Vue.js url', () => {
const options = {
vue: 'https://unpkg.com/vue'
}
const component = { template, data }
beforeEach(mountVue(component, options))
it('shows hello', () => {
cy.contains('Hello Vue!')
})
it('has version', () => {
cy.window().its('Vue.version').should('be.a', 'string')
})
})
describe('Pass window HTML to use', () => {
const vue = '../node_modules/vue/dist/vue.js'
const options = {
html: `<div id="app"></div><script src="${vue}"></script>`
}
const component = { template, data }
beforeEach(mountVue(component, options))
it('shows hello', () => {
cy.contains('Hello Vue!')
})
it('has version', () => {
cy.window().its('Vue.version').should('be.a', 'string')
})
})
describe('Pass Vue.js url and base tag', () => {
const options = {
vue: 'https://unpkg.com/vue',
base: '/'
}
const component = { template, data }
beforeEach(mountVue(component, options))
it('shows hello', () => {
cy.contains('Hello Vue!')
})
it('has version', () => {
cy.window().its('Vue.version').should('be.a', 'string')
})
})