forked from lukaszflorczak/vue-agile
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathsettings.spec.js
35 lines (29 loc) · 894 Bytes
/
settings.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
import { shallowMount } from '@vue/test-utils'
import Agile from '@/Agile.vue'
describe('Settings:', () => {
describe('initialSettings object:', () => {
test('should contain all possible props without options', async () => {
const { vm } = shallowMount(Agile)
const { initialSettings, $props } = vm
Object.keys($props).forEach(key => {
const condition = key !== 'options'
expect(initialSettings.hasOwnProperty(key)).toEqual(condition)
})
})
test('options object should be merged with other props', async () => {
const { vm } = shallowMount(Agile, {
propsData: {
options: {
infinite: false,
fade: true,
throttle: 0
}
}
})
const { initialSettings, $props } = vm
expect(initialSettings.infinite).toEqual(false)
expect(initialSettings.fade).toEqual(true)
expect(initialSettings.throttle).toEqual(0)
})
})
})