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.
66 lines
1.9 KiB
66 lines
1.9 KiB
'use strict';
|
|
|
|
import CallBlockingModule from '../../src/store/call-blocking';
|
|
import { assert } from 'chai';
|
|
|
|
describe('CallBlocking', function(){
|
|
|
|
describe('Incoming', function(){
|
|
|
|
it('should enable list', function(){
|
|
var state = {};
|
|
CallBlockingModule.mutations.toggleSucceeded(state, true);
|
|
assert.equal(state.enabled, true);
|
|
});
|
|
|
|
it('should disable list', function(){
|
|
var state = {};
|
|
CallBlockingModule.mutations.toggleSucceeded(state, false);
|
|
assert.equal(state.enabled, false);
|
|
});
|
|
|
|
it('should load list and flag', function(){
|
|
var state = {};
|
|
var list = [
|
|
'0123456789',
|
|
'0987654321'
|
|
];
|
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
|
enabled: true,
|
|
list: list
|
|
});
|
|
assert.equal(state.enabled, true);
|
|
assert.deepEqual(state.list, list);
|
|
});
|
|
});
|
|
|
|
describe('Outgoing', function(){
|
|
|
|
it('should enable list', function(){
|
|
var state = {};
|
|
CallBlockingModule.mutations.toggleSucceeded(state, true);
|
|
assert.equal(state.enabled, true);
|
|
});
|
|
|
|
it('should disable list', function(){
|
|
var state = {};
|
|
CallBlockingModule.mutations.toggleSucceeded(state, false);
|
|
assert.equal(state.enabled, false);
|
|
});
|
|
|
|
it('should load list and flag', function(){
|
|
var state = {};
|
|
var list = [
|
|
'0123456789',
|
|
'0987654321'
|
|
];
|
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
|
enabled: true,
|
|
list: list
|
|
});
|
|
assert.equal(state.enabled, true);
|
|
assert.deepEqual(state.list, list);
|
|
});
|
|
});
|
|
});
|