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.
46 lines
1.3 KiB
46 lines
1.3 KiB
|
|
'use strict';
|
|
|
|
import VoiceboxModule from '../../src/store/voicebox';
|
|
import { assert } from 'chai';
|
|
|
|
describe('Voicebox', function(){
|
|
|
|
it('should load all voicebox settings into store', function(){
|
|
let state = {
|
|
voiceboxSettingDelete: false,
|
|
voiceboxSettingAttach: false,
|
|
voiceboxSettingPin: '',
|
|
voiceboxSettingEmail: '',
|
|
};
|
|
let settings = {
|
|
attach: true,
|
|
delete: false,
|
|
email: '',
|
|
id: 123,
|
|
pin: 1234,
|
|
sms_number: ''
|
|
};
|
|
VoiceboxModule.mutations.loadSettingsSucceeded(state, settings);
|
|
assert.equal(state.voiceboxSettingDelete, settings.delete);
|
|
assert.equal(state.voiceboxSettingAttach, settings.attach);
|
|
assert.equal(state.voiceboxSettingEmail, settings.email);
|
|
assert.equal(state.voiceboxSettingPin, settings.pin);
|
|
|
|
});
|
|
|
|
it('should load all busy greeting id into store', function(){
|
|
let state = {
|
|
busyGreetingId: null
|
|
};
|
|
let greetings = [
|
|
{
|
|
id: 1
|
|
}
|
|
];
|
|
VoiceboxModule.mutations.loadBusyGreetingSucceeded(state, greetings);
|
|
assert.deepEqual(state.busyGreetingId, greetings[0].id);
|
|
});
|
|
|
|
});
|