You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
63 lines
1.8 KiB
63 lines
1.8 KiB
'use strict'
|
|
|
|
import { assert } from 'chai'
|
|
import CallBlockingModule from 'src/store/call-blocking'
|
|
|
|
describe('CallBlocking', () => {
|
|
describe('Incoming', () => {
|
|
it('should enable list', () => {
|
|
const state = {}
|
|
CallBlockingModule.mutations.toggleSucceeded(state, true)
|
|
assert.equal(state.enabled, true)
|
|
})
|
|
|
|
it('should disable list', () => {
|
|
const state = {}
|
|
CallBlockingModule.mutations.toggleSucceeded(state, false)
|
|
assert.equal(state.enabled, false)
|
|
})
|
|
|
|
it('should load list and flag', () => {
|
|
const state = {}
|
|
const list = [
|
|
'0123456789',
|
|
'0987654321'
|
|
]
|
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
|
enabled: true,
|
|
list
|
|
})
|
|
assert.equal(state.enabled, true)
|
|
assert.deepEqual(state.list, list)
|
|
})
|
|
})
|
|
|
|
describe('Outgoing', () => {
|
|
it('should enable list', () => {
|
|
const state = {}
|
|
CallBlockingModule.mutations.toggleSucceeded(state, true)
|
|
assert.equal(state.enabled, true)
|
|
})
|
|
|
|
it('should disable list', () => {
|
|
const state = {}
|
|
CallBlockingModule.mutations.toggleSucceeded(state, false)
|
|
assert.equal(state.enabled, false)
|
|
})
|
|
|
|
it('should load list and flag', () => {
|
|
const state = {}
|
|
const list = [
|
|
'0123456789',
|
|
'0987654321'
|
|
]
|
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
|
enabled: true,
|
|
list
|
|
})
|
|
assert.equal(state.enabled, true)
|
|
assert.deepEqual(state.list, list)
|
|
})
|
|
})
|
|
})
|