Change-Id: Ie523cc0bb7de3c36564f45060a1bd8e2f92f852dpull/4/head
parent
e4c421e1d9
commit
239466fcb5
@ -0,0 +1,66 @@
|
|||||||
|
<template>
|
||||||
|
<q-popup-proxy
|
||||||
|
ref="popup"
|
||||||
|
persistent
|
||||||
|
anchor="bottom middle"
|
||||||
|
self="top middle"
|
||||||
|
@before-show="beforeShow"
|
||||||
|
v-on="$listeners"
|
||||||
|
>
|
||||||
|
<slot />
|
||||||
|
</q-popup-proxy>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script>
|
||||||
|
import _ from 'lodash'
|
||||||
|
import {
|
||||||
|
v4
|
||||||
|
} from 'uuid'
|
||||||
|
import {
|
||||||
|
mapState,
|
||||||
|
mapMutations
|
||||||
|
} from 'vuex'
|
||||||
|
export default {
|
||||||
|
name: 'CscCfConditionPopup',
|
||||||
|
data () {
|
||||||
|
return {
|
||||||
|
popupId: _.kebabCase(this.$options.name) + '-' + v4()
|
||||||
|
}
|
||||||
|
},
|
||||||
|
computed: {
|
||||||
|
...mapState('callForwarding', [
|
||||||
|
'popupCurrent'
|
||||||
|
])
|
||||||
|
},
|
||||||
|
watch: {
|
||||||
|
popupCurrent (id) {
|
||||||
|
if (id === null || this.popupId !== id) {
|
||||||
|
this.close()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
methods: {
|
||||||
|
...mapMutations('callForwarding', [
|
||||||
|
'popupShow'
|
||||||
|
]),
|
||||||
|
beforeShow () {
|
||||||
|
this.closed = false
|
||||||
|
this.popupShow(this.popupId)
|
||||||
|
},
|
||||||
|
close () {
|
||||||
|
this.closed = true
|
||||||
|
this.$refs.popup.hide()
|
||||||
|
this.$emit('close')
|
||||||
|
},
|
||||||
|
reOpen () {
|
||||||
|
if (!this.closed) {
|
||||||
|
this.$refs.popup.hide()
|
||||||
|
this.$nextTick(() => {
|
||||||
|
this.$refs.popup.show()
|
||||||
|
this.$emit('open')
|
||||||
|
})
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
</script>
|
File diff suppressed because it is too large
Load Diff
@ -1,97 +1,94 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue'
|
||||||
import VueResource from 'vue-resource';
|
import VueResource from 'vue-resource'
|
||||||
import crypto from 'crypto-browserify'
|
import crypto from 'crypto-browserify'
|
||||||
import { getConversations } from '../../src/api/conversations';
|
import { getConversations } from '../../src/api/conversations'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
Vue.use(VueResource);
|
Vue.use(VueResource)
|
||||||
|
|
||||||
describe('Conversations', function(){
|
describe('Conversations', function () {
|
||||||
|
const subscriberId = 123
|
||||||
|
|
||||||
const subscriberId = 123;
|
it('should get all data regarding conversations', function (done) {
|
||||||
|
const innerData = [{
|
||||||
it('should get all data regarding conversations', function(done){
|
_links: {
|
||||||
|
collection: {
|
||||||
let innerData = [{
|
href: '/api/conversations/'
|
||||||
"_links" : {
|
|
||||||
"collection": {
|
|
||||||
"href": "/api/conversations/"
|
|
||||||
},
|
},
|
||||||
"curies": {
|
curies: {
|
||||||
"href": "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
|
href: 'http://purl.org/sipwise/ngcp-api/#rel-{rel}',
|
||||||
"name": "ngcp",
|
name: 'ngcp',
|
||||||
"templated": true
|
templated: true
|
||||||
},
|
},
|
||||||
"ngcp:conversations": {
|
'ngcp:conversations': {
|
||||||
"href": "/api/conversations/1?type=voicemail"
|
href: '/api/conversations/1?type=voicemail'
|
||||||
},
|
},
|
||||||
"ngcp:voicemailrecordings": {
|
'ngcp:voicemailrecordings': {
|
||||||
"href": "/api/voicemailrecordings/1"
|
href: '/api/voicemailrecordings/1'
|
||||||
},
|
},
|
||||||
"ngcp:voicemails": {
|
'ngcp:voicemails': {
|
||||||
"href": "/api/voicemails/1"
|
href: '/api/voicemails/1'
|
||||||
},
|
},
|
||||||
"profile": {
|
profile: {
|
||||||
"href": "http://purl.org/sipwise/ngcp-api/"
|
href: 'http://purl.org/sipwise/ngcp-api/'
|
||||||
},
|
},
|
||||||
"self": {
|
self: {
|
||||||
"href": "/api/conversations/1?type=voicemail"
|
href: '/api/conversations/1?type=voicemail'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"call_id": "kp55kEGtNp",
|
call_id: 'kp55kEGtNp',
|
||||||
"callee": "43993006",
|
callee: '43993006',
|
||||||
"caller": "43993006",
|
caller: '43993006',
|
||||||
"context": "voicemailcaller_unavail",
|
context: 'voicemailcaller_unavail',
|
||||||
"direction": "in",
|
direction: 'in',
|
||||||
"duration": "15",
|
duration: '15',
|
||||||
"filename": "voicemail-0.wav",
|
filename: 'voicemail-0.wav',
|
||||||
"folder": "Old",
|
folder: 'Old',
|
||||||
"id": 1,
|
id: 1,
|
||||||
"start_time": "2017-12-07 16:22:04",
|
start_time: '2017-12-07 16:22:04',
|
||||||
"type": "voicemail",
|
type: 'voicemail',
|
||||||
"voicemail_subscriber_id": 235
|
voicemail_subscriber_id: 235
|
||||||
}];
|
}]
|
||||||
|
|
||||||
let data = {
|
const data = {
|
||||||
"_embedded": {
|
_embedded: {
|
||||||
"ngcp:conversations": innerData
|
'ngcp:conversations': innerData
|
||||||
},
|
},
|
||||||
total_count: 1
|
total_count: 1
|
||||||
};
|
}
|
||||||
|
|
||||||
let innerDataTransformed = {
|
const innerDataTransformed = {
|
||||||
items: [{
|
items: [{
|
||||||
"call_id": "kp55kEGtNp",
|
call_id: 'kp55kEGtNp',
|
||||||
"callee": "43993006",
|
callee: '43993006',
|
||||||
"caller": "43993006",
|
caller: '43993006',
|
||||||
"context": "voicemailcaller_unavail",
|
context: 'voicemailcaller_unavail',
|
||||||
"direction": "in",
|
direction: 'in',
|
||||||
"duration": "15",
|
duration: '15',
|
||||||
"filename": "voicemail-0.wav",
|
filename: 'voicemail-0.wav',
|
||||||
"folder": "Old",
|
folder: 'Old',
|
||||||
"id": 1,
|
id: 1,
|
||||||
"start_time": "2017-12-07 16:22:04",
|
start_time: '2017-12-07 16:22:04',
|
||||||
"type": "voicemail",
|
type: 'voicemail',
|
||||||
"voicemail_subscriber_id": 235
|
voicemail_subscriber_id: 235
|
||||||
}],
|
}],
|
||||||
lastPage: 1
|
lastPage: 1
|
||||||
};
|
}
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next)=>{
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getConversations(subscriberId).then((result)=>{
|
getConversations(subscriberId).then((result) => {
|
||||||
assert.deepEqual(result, innerDataTransformed);
|
assert.deepEqual(result, innerDataTransformed)
|
||||||
done();
|
done()
|
||||||
}).catch((err)=>{
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,196 +1,192 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue'
|
||||||
import VueResource from 'vue-resource';
|
import VueResource from 'vue-resource'
|
||||||
import {
|
import {
|
||||||
getFieldList
|
getFieldList
|
||||||
} from '../../src/api/common';
|
} from '../../src/api/common'
|
||||||
import {
|
import {
|
||||||
getSpeedDialsById,
|
getSpeedDialsById,
|
||||||
getUnassignedSlots
|
getUnassignedSlots
|
||||||
} from '../../src/api/speed-dial';
|
} from '../../src/api/speed-dial'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
import { i18n } from '../../src/i18n';
|
import { i18n } from '../../src/i18n'
|
||||||
|
|
||||||
Vue.use(VueResource);
|
Vue.use(VueResource)
|
||||||
|
|
||||||
describe('SpeedDial', function(){
|
describe('SpeedDial', function () {
|
||||||
|
const subscriberId = 123
|
||||||
|
|
||||||
const subscriberId = 123;
|
it('should get list of subscriber specific speed dials', function (done) {
|
||||||
|
const data = {
|
||||||
it('should get list of subscriber specific speed dials', function(done){
|
_links: {
|
||||||
|
collection: {
|
||||||
let data = {
|
href: '/api/speeddials/'
|
||||||
"_links" : {
|
|
||||||
"collection" : {
|
|
||||||
"href" : "/api/speeddials/"
|
|
||||||
},
|
},
|
||||||
"curies" : {
|
curies: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
|
href: 'http://purl.org/sipwise/ngcp-api/#rel-{rel}',
|
||||||
"name" : "ngcp",
|
name: 'ngcp',
|
||||||
"templated" : true
|
templated: true
|
||||||
},
|
},
|
||||||
"ngcp:journal" : [
|
'ngcp:journal': [
|
||||||
{
|
{
|
||||||
"href" : "/api/speeddials/323/journal/"
|
href: '/api/speeddials/323/journal/'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ngcp:speeddials" : [
|
'ngcp:speeddials': [
|
||||||
{
|
{
|
||||||
"href" : "/api/speeddials/323"
|
href: '/api/speeddials/323'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ngcp:subscribers" : [
|
'ngcp:subscribers': [
|
||||||
{
|
{
|
||||||
"href" : "/api/subscribers/323"
|
href: '/api/subscribers/323'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"profile" : {
|
profile: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/"
|
href: 'http://purl.org/sipwise/ngcp-api/'
|
||||||
},
|
},
|
||||||
"self" : {
|
self: {
|
||||||
"href" : "/api/speeddials/323"
|
href: '/api/speeddials/323'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"speeddials" : [
|
speeddials: [
|
||||||
{
|
{
|
||||||
"destination" : "sip:439965050@192.168.178.23",
|
destination: 'sip:439965050@192.168.178.23',
|
||||||
"slot" : "*9"
|
slot: '*9'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:22222222@192.168.178.23",
|
destination: 'sip:22222222@192.168.178.23',
|
||||||
"slot" : "*0"
|
slot: '*0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:43665522@192.168.178.23",
|
destination: 'sip:43665522@192.168.178.23',
|
||||||
"slot" : "*3"
|
slot: '*3'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
|
|
||||||
let fieldList = [
|
const fieldList = [
|
||||||
{
|
{
|
||||||
"destination" : "sip:22222222@192.168.178.23",
|
destination: 'sip:22222222@192.168.178.23',
|
||||||
"slot" : "*0"
|
slot: '*0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:43665522@192.168.178.23",
|
destination: 'sip:43665522@192.168.178.23',
|
||||||
"slot" : "*3"
|
slot: '*3'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:439965050@192.168.178.23",
|
destination: 'sip:439965050@192.168.178.23',
|
||||||
"slot" : "*9"
|
slot: '*9'
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next)=>{
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getSpeedDialsById(subscriberId).then((result)=>{
|
getSpeedDialsById(subscriberId).then((result) => {
|
||||||
assert.deepEqual(result, fieldList);
|
assert.deepEqual(result, fieldList)
|
||||||
done();
|
done()
|
||||||
}).catch((err)=>{
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should get list of unassigned speed dial slots', function(done){
|
it('should get list of unassigned speed dial slots', function (done) {
|
||||||
|
const data = {
|
||||||
let data = {
|
_links: {
|
||||||
"_links" : {
|
collection: {
|
||||||
"collection" : {
|
href: '/api/speeddials/'
|
||||||
"href" : "/api/speeddials/"
|
|
||||||
},
|
},
|
||||||
"curies" : {
|
curies: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
|
href: 'http://purl.org/sipwise/ngcp-api/#rel-{rel}',
|
||||||
"name" : "ngcp",
|
name: 'ngcp',
|
||||||
"templated" : true
|
templated: true
|
||||||
},
|
},
|
||||||
"ngcp:journal" : [
|
'ngcp:journal': [
|
||||||
{
|
{
|
||||||
"href" : "/api/speeddials/323/journal/"
|
href: '/api/speeddials/323/journal/'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ngcp:speeddials" : [
|
'ngcp:speeddials': [
|
||||||
{
|
{
|
||||||
"href" : "/api/speeddials/323"
|
href: '/api/speeddials/323'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ngcp:subscribers" : [
|
'ngcp:subscribers': [
|
||||||
{
|
{
|
||||||
"href" : "/api/subscribers/323"
|
href: '/api/subscribers/323'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"profile" : {
|
profile: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/"
|
href: 'http://purl.org/sipwise/ngcp-api/'
|
||||||
},
|
},
|
||||||
"self" : {
|
self: {
|
||||||
"href" : "/api/speeddials/323"
|
href: '/api/speeddials/323'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"speeddials" : [
|
speeddials: [
|
||||||
{
|
{
|
||||||
"destination" : "sip:439965050@192.168.178.23",
|
destination: 'sip:439965050@192.168.178.23',
|
||||||
"slot" : "*9"
|
slot: '*9'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:22222222@192.168.178.23",
|
destination: 'sip:22222222@192.168.178.23',
|
||||||
"slot" : "*0"
|
slot: '*0'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"destination" : "sip:43665522@192.168.178.23",
|
destination: 'sip:43665522@192.168.178.23',
|
||||||
"slot" : "*3"
|
slot: '*3'
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
|
|
||||||
let slotOptions = [
|
const slotOptions = [
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *1"),
|
label: i18n.t('speedDial.slot').concat(' *1'),
|
||||||
"value" : "*1"
|
value: '*1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *2"),
|
label: i18n.t('speedDial.slot').concat(' *2'),
|
||||||
"value" : "*2"
|
value: '*2'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *4"),
|
label: i18n.t('speedDial.slot').concat(' *4'),
|
||||||
"value" : "*4"
|
value: '*4'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *5"),
|
label: i18n.t('speedDial.slot').concat(' *5'),
|
||||||
"value" : "*5"
|
value: '*5'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *6"),
|
label: i18n.t('speedDial.slot').concat(' *6'),
|
||||||
"value" : "*6"
|
value: '*6'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *7"),
|
label: i18n.t('speedDial.slot').concat(' *7'),
|
||||||
"value" : "*7"
|
value: '*7'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
"label" : i18n.t('speedDial.slot').concat(" *8"),
|
label: i18n.t('speedDial.slot').concat(' *8'),
|
||||||
"value" : "*8"
|
value: '*8'
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next)=>{
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getUnassignedSlots(subscriberId).then((result)=>{
|
getUnassignedSlots(subscriberId).then((result) => {
|
||||||
assert.deepEqual(result, slotOptions);
|
assert.deepEqual(result, slotOptions)
|
||||||
done();
|
done()
|
||||||
}).catch((err)=>{
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,52 +1,51 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue'
|
||||||
import VueResource from 'vue-resource';
|
import VueResource from 'vue-resource'
|
||||||
import { getPreferences } from '../../src/api/subscriber';
|
import { getPreferences } from '../../src/api/subscriber'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
Vue.use(VueResource);
|
Vue.use(VueResource)
|
||||||
|
|
||||||
describe('Subscriber', function(){
|
describe('Subscriber', function () {
|
||||||
|
const subscriberId = 123
|
||||||
|
|
||||||
const subscriberId = 123;
|
it('should get all subscriber preferences', function (done) {
|
||||||
|
Vue.http.interceptors = []
|
||||||
it('should get all subscriber preferences', function(done) {
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
Vue.http.interceptors = [];
|
|
||||||
Vue.http.interceptors.unshift((request, next)=>{
|
|
||||||
next(request.respondWith(JSON.stringify({
|
next(request.respondWith(JSON.stringify({
|
||||||
block_in_mode: false,
|
block_in_mode: false,
|
||||||
clir: false
|
clir: false
|
||||||
}), {
|
}), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getPreferences(subscriberId).then((result)=>{
|
getPreferences(subscriberId).then((result) => {
|
||||||
assert.property(result, 'block_in_mode');
|
assert.property(result, 'block_in_mode')
|
||||||
assert.isFalse(result.block_in_mode);
|
assert.isFalse(result.block_in_mode)
|
||||||
assert.property(result, 'clir');
|
assert.property(result, 'clir')
|
||||||
assert.isFalse(result.clir);
|
assert.isFalse(result.clir)
|
||||||
done();
|
done()
|
||||||
}).catch((err)=>{
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should handle a 403 Forbidden while requesting the preferences', function(done) {
|
it('should handle a 403 Forbidden while requesting the preferences', function (done) {
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next)=>{
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify({
|
next(request.respondWith(JSON.stringify({
|
||||||
message: '403 Forbidden'
|
message: '403 Forbidden'
|
||||||
}), {
|
}), {
|
||||||
status: 403
|
status: 403
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getPreferences(subscriberId).then(()=>{
|
getPreferences(subscriberId).then(() => {
|
||||||
done(new Error('Test failed'));
|
done(new Error('Test failed'))
|
||||||
}).catch((err)=>{
|
}).catch((err) => {
|
||||||
assert.equal(err.status, 403);
|
assert.equal(err.status, 403)
|
||||||
done();
|
done()
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
@ -1,152 +1,147 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import Vue from 'vue';
|
import Vue from 'vue'
|
||||||
import VueResource from 'vue-resource';
|
import VueResource from 'vue-resource'
|
||||||
import {
|
import {
|
||||||
get,
|
get,
|
||||||
getList
|
getList
|
||||||
} from '../../src/api/common';
|
} from '../../src/api/common'
|
||||||
import {
|
import {
|
||||||
getVoiceboxSettings,
|
getVoiceboxSettings,
|
||||||
getVoiceboxGreetingByType
|
getVoiceboxGreetingByType
|
||||||
} from '../../src/api/voicebox';
|
} from '../../src/api/voicebox'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
Vue.use(VueResource);
|
Vue.use(VueResource)
|
||||||
|
|
||||||
describe('Voicebox', function() {
|
describe('Voicebox', function () {
|
||||||
|
const subscriberId = 123
|
||||||
|
|
||||||
const subscriberId = 123;
|
it('should get subscriber\'s voicebox settings', function (done) {
|
||||||
|
const data = {
|
||||||
it('should get subscriber\'s voicebox settings', function(done) {
|
_links: {
|
||||||
|
collection: {
|
||||||
let data = {
|
href: '/api/voicemailsettings/'
|
||||||
"_links" : {
|
|
||||||
"collection" : {
|
|
||||||
"href" : "/api/voicemailsettings/"
|
|
||||||
},
|
},
|
||||||
"curies" : {
|
curies: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/#rel-{rel}",
|
href: 'http://purl.org/sipwise/ngcp-api/#rel-{rel}',
|
||||||
"name" : "ngcp",
|
name: 'ngcp',
|
||||||
"templated" : true
|
templated: true
|
||||||
},
|
},
|
||||||
"ngcp:journal" : [
|
'ngcp:journal': [
|
||||||
{
|
{
|
||||||
"href" : "/api/voicemailsettings/123/journal/"
|
href: '/api/voicemailsettings/123/journal/'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"ngcp:subscribers" : [
|
'ngcp:subscribers': [
|
||||||
{
|
{
|
||||||
"href" : "/api/subscribers/123"
|
href: '/api/subscribers/123'
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"profile" : {
|
profile: {
|
||||||
"href" : "http://purl.org/sipwise/ngcp-api/"
|
href: 'http://purl.org/sipwise/ngcp-api/'
|
||||||
},
|
},
|
||||||
"self" : {
|
self: {
|
||||||
"href" : "/api/voicemailsettings/123"
|
href: '/api/voicemailsettings/123'
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
"attach" : true,
|
attach: true,
|
||||||
"delete" : false,
|
delete: false,
|
||||||
"email" : "",
|
email: '',
|
||||||
"id" : 123,
|
id: 123,
|
||||||
"pin" : "1234",
|
pin: '1234',
|
||||||
"sms_number" : ""
|
sms_number: ''
|
||||||
};
|
}
|
||||||
|
|
||||||
let settings = {
|
const settings = {
|
||||||
"attach" : true,
|
attach: true,
|
||||||
"delete" : false,
|
delete: false,
|
||||||
"email" : "",
|
email: '',
|
||||||
"id" : 123,
|
id: 123,
|
||||||
"pin" : "1234",
|
pin: '1234',
|
||||||
"sms_number" : ""
|
sms_number: ''
|
||||||
};
|
}
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next) => {
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getVoiceboxSettings(subscriberId).then((result) => {
|
getVoiceboxSettings(subscriberId).then((result) => {
|
||||||
assert.deepEqual(result, settings);
|
assert.deepEqual(result, settings)
|
||||||
done();
|
done()
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should get subscriber\'s busy greeting', function(done) {
|
it('should get subscriber\'s busy greeting', function (done) {
|
||||||
|
const data = {
|
||||||
let data = {
|
_embedded: {
|
||||||
"_embedded" : {
|
'ngcp:voicemailgreetings': [
|
||||||
"ngcp:voicemailgreetings" : [
|
|
||||||
{
|
{
|
||||||
"dir" : "busy",
|
dir: 'busy',
|
||||||
"id" : 1,
|
id: 1,
|
||||||
"subscriber_id" : 123
|
subscriber_id: 123
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"total_count" : 1
|
total_count: 1
|
||||||
};
|
}
|
||||||
|
|
||||||
let greeting = {
|
const greeting = {
|
||||||
"dir" : "busy",
|
dir: 'busy',
|
||||||
"id" : 1,
|
id: 1,
|
||||||
"subscriber_id" : 123
|
subscriber_id: 123
|
||||||
};
|
}
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next) => {
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getVoiceboxGreetingByType({id: subscriberId, type: 'busy'}).then((result) => {
|
getVoiceboxGreetingByType({ id: subscriberId, type: 'busy' }).then((result) => {
|
||||||
assert.deepEqual(result.items[0], greeting);
|
assert.deepEqual(result.items[0], greeting)
|
||||||
done();
|
done()
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should get subscriber\'s unavailable greeting', function(done) {
|
it('should get subscriber\'s unavailable greeting', function (done) {
|
||||||
|
const data = {
|
||||||
let data = {
|
_embedded: {
|
||||||
"_embedded" : {
|
'ngcp:voicemailgreetings': [
|
||||||
"ngcp:voicemailgreetings" : [
|
|
||||||
{
|
{
|
||||||
"dir" : "unavail",
|
dir: 'unavail',
|
||||||
"id" : 1,
|
id: 1,
|
||||||
"subscriber_id" : 123
|
subscriber_id: 123
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
"total_count" : 1
|
total_count: 1
|
||||||
};
|
}
|
||||||
|
|
||||||
let greeting = {
|
const greeting = {
|
||||||
"dir" : "unavail",
|
dir: 'unavail',
|
||||||
"id" : 1,
|
id: 1,
|
||||||
"subscriber_id" : 123
|
subscriber_id: 123
|
||||||
};
|
}
|
||||||
|
|
||||||
Vue.http.interceptors = [];
|
Vue.http.interceptors = []
|
||||||
Vue.http.interceptors.unshift((request, next) => {
|
Vue.http.interceptors.unshift((request, next) => {
|
||||||
next(request.respondWith(JSON.stringify(data), {
|
next(request.respondWith(JSON.stringify(data), {
|
||||||
status: 200
|
status: 200
|
||||||
}));
|
}))
|
||||||
});
|
})
|
||||||
getVoiceboxGreetingByType({id: subscriberId, type: 'unavail'}).then((result) => {
|
getVoiceboxGreetingByType({ id: subscriberId, type: 'unavail' }).then((result) => {
|
||||||
assert.deepEqual(result.items[0], greeting);
|
assert.deepEqual(result.items[0], greeting)
|
||||||
done();
|
done()
|
||||||
}).catch((err) => {
|
}).catch((err) => {
|
||||||
done(err);
|
done(err)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,13 +1,12 @@
|
|||||||
|
|
||||||
import Vue from 'vue'
|
import Vue from 'vue'
|
||||||
import Login from '../../src/components/Login.vue'
|
import Login from '../../src/components/Login.vue'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('Login', function() {
|
describe('Login', function () {
|
||||||
|
it('should initialize with default data', function () {
|
||||||
it('should initialize with default data', function(){
|
var defaultData = Login.data()
|
||||||
var defaultData = Login.data();
|
assert.equal(defaultData.username, '')
|
||||||
assert.equal(defaultData.username, '');
|
assert.equal(defaultData.password, '')
|
||||||
assert.equal(defaultData.password, '');
|
})
|
||||||
});
|
})
|
||||||
});
|
|
||||||
|
@ -1,65 +1,62 @@
|
|||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import CallBlockingModule from '../../src/store/call-blocking';
|
import CallBlockingModule from '../../src/store/call-blocking'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('CallBlocking', function(){
|
describe('CallBlocking', function () {
|
||||||
|
describe('Incoming', function () {
|
||||||
describe('Incoming', function(){
|
it('should enable list', function () {
|
||||||
|
var state = {}
|
||||||
it('should enable list', function(){
|
CallBlockingModule.mutations.toggleSucceeded(state, true)
|
||||||
var state = {};
|
assert.equal(state.enabled, true)
|
||||||
CallBlockingModule.mutations.toggleSucceeded(state, true);
|
})
|
||||||
assert.equal(state.enabled, true);
|
|
||||||
});
|
it('should disable list', function () {
|
||||||
|
var state = {}
|
||||||
it('should disable list', function(){
|
CallBlockingModule.mutations.toggleSucceeded(state, false)
|
||||||
var state = {};
|
assert.equal(state.enabled, false)
|
||||||
CallBlockingModule.mutations.toggleSucceeded(state, false);
|
})
|
||||||
assert.equal(state.enabled, false);
|
|
||||||
});
|
it('should load list and flag', function () {
|
||||||
|
var state = {}
|
||||||
it('should load list and flag', function(){
|
|
||||||
var state = {};
|
|
||||||
var list = [
|
var list = [
|
||||||
'0123456789',
|
'0123456789',
|
||||||
'0987654321'
|
'0987654321'
|
||||||
];
|
]
|
||||||
CallBlockingModule.mutations.numberListSucceeded(state, {
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
list: list
|
list: list
|
||||||
});
|
})
|
||||||
assert.equal(state.enabled, true);
|
assert.equal(state.enabled, true)
|
||||||
assert.deepEqual(state.list, list);
|
assert.deepEqual(state.list, list)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
describe('Outgoing', function(){
|
describe('Outgoing', function () {
|
||||||
|
it('should enable list', function () {
|
||||||
it('should enable list', function(){
|
var state = {}
|
||||||
var state = {};
|
CallBlockingModule.mutations.toggleSucceeded(state, true)
|
||||||
CallBlockingModule.mutations.toggleSucceeded(state, true);
|
assert.equal(state.enabled, true)
|
||||||
assert.equal(state.enabled, true);
|
})
|
||||||
});
|
|
||||||
|
it('should disable list', function () {
|
||||||
it('should disable list', function(){
|
var state = {}
|
||||||
var state = {};
|
CallBlockingModule.mutations.toggleSucceeded(state, false)
|
||||||
CallBlockingModule.mutations.toggleSucceeded(state, false);
|
assert.equal(state.enabled, false)
|
||||||
assert.equal(state.enabled, false);
|
})
|
||||||
});
|
|
||||||
|
it('should load list and flag', function () {
|
||||||
it('should load list and flag', function(){
|
var state = {}
|
||||||
var state = {};
|
|
||||||
var list = [
|
var list = [
|
||||||
'0123456789',
|
'0123456789',
|
||||||
'0987654321'
|
'0987654321'
|
||||||
];
|
]
|
||||||
CallBlockingModule.mutations.numberListSucceeded(state, {
|
CallBlockingModule.mutations.numberListSucceeded(state, {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
list: list
|
list: list
|
||||||
});
|
})
|
||||||
assert.equal(state.enabled, true);
|
assert.equal(state.enabled, true)
|
||||||
assert.deepEqual(state.list, list);
|
assert.deepEqual(state.list, list)
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
@ -1,98 +1,89 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import ConferenceModule from '../../src/store/conference';
|
import ConferenceModule from '../../src/store/conference'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('Conference', function(){
|
|
||||||
|
|
||||||
|
describe('Conference', function () {
|
||||||
it('should add a participant id to the store if not already stored', () => {
|
it('should add a participant id to the store if not already stored', () => {
|
||||||
let state = {
|
const state = {
|
||||||
participants: []
|
participants: []
|
||||||
};
|
}
|
||||||
const participant = {
|
const participant = {
|
||||||
getId: () => {
|
getId: () => {
|
||||||
return '123456789';
|
return '123456789'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
ConferenceModule.mutations.participantJoined(state, participant);
|
ConferenceModule.mutations.participantJoined(state, participant)
|
||||||
assert.include(state.participants, participant.getId());
|
assert.include(state.participants, participant.getId())
|
||||||
|
})
|
||||||
});
|
|
||||||
|
|
||||||
it('should not add a participant id to the store if already stored', () => {
|
it('should not add a participant id to the store if already stored', () => {
|
||||||
let state = {
|
const state = {
|
||||||
participants: ['123456789']
|
participants: ['123456789']
|
||||||
};
|
}
|
||||||
const participant = {
|
const participant = {
|
||||||
getId: () => {
|
getId: () => {
|
||||||
return '123456789';
|
return '123456789'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
ConferenceModule.mutations.participantJoined(state, participant);
|
ConferenceModule.mutations.participantJoined(state, participant)
|
||||||
assert.equal(state.participants.length, 1);
|
assert.equal(state.participants.length, 1)
|
||||||
|
})
|
||||||
});
|
|
||||||
|
|
||||||
it('should remove a participant id from the store', () => {
|
it('should remove a participant id from the store', () => {
|
||||||
let state = {
|
const state = {
|
||||||
participants: ['123456789']
|
participants: ['123456789']
|
||||||
};
|
}
|
||||||
const participant = {
|
const participant = {
|
||||||
getId: () => {
|
getId: () => {
|
||||||
return '123456789';
|
return '123456789'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
ConferenceModule.mutations.participantLeft(state, participant);
|
ConferenceModule.mutations.participantLeft(state, participant)
|
||||||
assert.notInclude(state.participants, participant.getId());
|
assert.notInclude(state.participants, participant.getId())
|
||||||
|
})
|
||||||
});
|
|
||||||
|
|
||||||
it('should remove a participant mediastream from the store', () => {
|
it('should remove a participant mediastream from the store', () => {
|
||||||
let state = {
|
const state = {
|
||||||
remoteMediaStreams: {
|
remoteMediaStreams: {
|
||||||
123456789: '123456789'
|
123456789: '123456789'
|
||||||
}
|
}
|
||||||
};
|
}
|
||||||
const participantId = '123456789';
|
const participantId = '123456789'
|
||||||
|
|
||||||
ConferenceModule.mutations.removeRemoteMedia(state, participantId);
|
|
||||||
assert.notExists(state.remoteMediaStreams[participantId]);
|
|
||||||
|
|
||||||
});
|
ConferenceModule.mutations.removeRemoteMedia(state, participantId)
|
||||||
|
assert.notExists(state.remoteMediaStreams[participantId])
|
||||||
|
})
|
||||||
|
|
||||||
it('should store the selected remote participant as selected', () => {
|
it('should store the selected remote participant as selected', () => {
|
||||||
let state = {
|
const state = {
|
||||||
selectedParticipant: null
|
selectedParticipant: null
|
||||||
};
|
}
|
||||||
const participantId = '123456789';
|
const participantId = '123456789'
|
||||||
|
|
||||||
ConferenceModule.mutations.setSelectedParticipant(state, participantId);
|
|
||||||
assert.equal(state.selectedParticipant, participantId);
|
|
||||||
|
|
||||||
});
|
ConferenceModule.mutations.setSelectedParticipant(state, participantId)
|
||||||
|
assert.equal(state.selectedParticipant, participantId)
|
||||||
|
})
|
||||||
|
|
||||||
it('should store the local participant as selected if current selected participant leaves', () => {
|
it('should store the local participant as selected if current selected participant leaves', () => {
|
||||||
let state = {
|
const state = {
|
||||||
selectedParticipant: '123456789',
|
selectedParticipant: '123456789',
|
||||||
participants: []
|
participants: []
|
||||||
};
|
}
|
||||||
const participantId = '123456789';
|
const participantId = '123456789'
|
||||||
|
|
||||||
ConferenceModule.mutations.setSelectedParticipant(state, participantId);
|
|
||||||
assert.equal(state.selectedParticipant, 'local');
|
|
||||||
|
|
||||||
});
|
ConferenceModule.mutations.setSelectedParticipant(state, participantId)
|
||||||
|
assert.equal(state.selectedParticipant, 'local')
|
||||||
|
})
|
||||||
|
|
||||||
it('should reset the selected participant when conference ends', () => {
|
it('should reset the selected participant when conference ends', () => {
|
||||||
let state = {
|
const state = {
|
||||||
selectedParticipant: 'local',
|
selectedParticipant: 'local',
|
||||||
joinState: false
|
joinState: false
|
||||||
};
|
}
|
||||||
|
|
||||||
ConferenceModule.mutations.setSelectedParticipant(state);
|
|
||||||
assert.equal(state.selectedParticipant, null);
|
|
||||||
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
ConferenceModule.mutations.setSelectedParticipant(state)
|
||||||
|
assert.equal(state.selectedParticipant, null)
|
||||||
|
})
|
||||||
|
})
|
||||||
|
@ -1,154 +1,152 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import ConversationsModule from '../../src/store/conversations/conversations';
|
import ConversationsModule from '../../src/store/conversations/conversations'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('Conversations', function(){
|
describe('Conversations', function () {
|
||||||
|
it('should load next page of items', function () {
|
||||||
it('should load next page of items', function(){
|
const resultItems = []
|
||||||
let resultItems = [];
|
const state = {
|
||||||
let state = {
|
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
call_id: "8fe2fa2f-84bc-48be-977d-84984aa5cc29",
|
call_id: '8fe2fa2f-84bc-48be-977d-84984aa5cc29',
|
||||||
call_type: "call",
|
call_type: 'call',
|
||||||
callee: "43993006",
|
callee: '43993006',
|
||||||
caller: "43993004",
|
caller: '43993004',
|
||||||
currency: "",
|
currency: '',
|
||||||
customer_cost: 0,
|
customer_cost: 0,
|
||||||
direction: "out",
|
direction: 'out',
|
||||||
duration: "0:00:00",
|
duration: '0:00:00',
|
||||||
id: 85,
|
id: 85,
|
||||||
rating_status: "ok",
|
rating_status: 'ok',
|
||||||
start_time: "2018-06-21 14:50:00.687",
|
start_time: '2018-06-21 14:50:00.687',
|
||||||
status: "noanswer",
|
status: 'noanswer',
|
||||||
total_customer_cost: 0,
|
total_customer_cost: 0,
|
||||||
type: "call",
|
type: 'call',
|
||||||
_links: {
|
_links: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
let data = {
|
const data = {
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
call_id: "8fe2fa2f-84bc-48be-977d-84984aa5cc29",
|
call_id: '8fe2fa2f-84bc-48be-977d-84984aa5cc29',
|
||||||
call_type: "call",
|
call_type: 'call',
|
||||||
callee: "43993006",
|
callee: '43993006',
|
||||||
caller: "43993004",
|
caller: '43993004',
|
||||||
currency: "",
|
currency: '',
|
||||||
customer_cost: 0,
|
customer_cost: 0,
|
||||||
direction: "out",
|
direction: 'out',
|
||||||
duration: "0:00:00",
|
duration: '0:00:00',
|
||||||
id: 85,
|
id: 85,
|
||||||
rating_status: "ok",
|
rating_status: 'ok',
|
||||||
start_time: "2018-06-21 14:50:00.687",
|
start_time: '2018-06-21 14:50:00.687',
|
||||||
status: "noanswer",
|
status: 'noanswer',
|
||||||
total_customer_cost: 0,
|
total_customer_cost: 0,
|
||||||
type: "call",
|
type: 'call',
|
||||||
_links: {
|
_links: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
lastPage: 1
|
lastPage: 1
|
||||||
};
|
}
|
||||||
resultItems.push(state.items[0]);
|
resultItems.push(state.items[0])
|
||||||
resultItems.push(data.items[0]);
|
resultItems.push(data.items[0])
|
||||||
ConversationsModule.mutations.nextPageSucceeded(state, data);
|
ConversationsModule.mutations.nextPageSucceeded(state, data)
|
||||||
assert.deepEqual(state.items, resultItems);
|
assert.deepEqual(state.items, resultItems)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load reloaded items', function(){
|
it('should load reloaded items', function () {
|
||||||
let state = {
|
const state = {
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
call_id: "8fe2fa2f-84bc-48be-977d-84984aa5cc29",
|
call_id: '8fe2fa2f-84bc-48be-977d-84984aa5cc29',
|
||||||
call_type: "call",
|
call_type: 'call',
|
||||||
callee: "43993006",
|
callee: '43993006',
|
||||||
caller: "43993004",
|
caller: '43993004',
|
||||||
currency: "",
|
currency: '',
|
||||||
customer_cost: 0,
|
customer_cost: 0,
|
||||||
direction: "out",
|
direction: 'out',
|
||||||
duration: "0:00:00",
|
duration: '0:00:00',
|
||||||
id: 85,
|
id: 85,
|
||||||
rating_status: "ok",
|
rating_status: 'ok',
|
||||||
start_time: "2018-06-21 14:50:00.687",
|
start_time: '2018-06-21 14:50:00.687',
|
||||||
status: "noanswer",
|
status: 'noanswer',
|
||||||
total_customer_cost: 0,
|
total_customer_cost: 0,
|
||||||
type: "call",
|
type: 'call',
|
||||||
_links: {
|
_links: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
let data = {
|
const data = {
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
call_id: "d2212956-46cc-4f9d-805d-cf2b5f572726",
|
call_id: 'd2212956-46cc-4f9d-805d-cf2b5f572726',
|
||||||
call_type: "call",
|
call_type: 'call',
|
||||||
callee: "43993007",
|
callee: '43993007',
|
||||||
caller: "43993004",
|
caller: '43993004',
|
||||||
currency: "",
|
currency: '',
|
||||||
customer_cost: 0,
|
customer_cost: 0,
|
||||||
direction: "out",
|
direction: 'out',
|
||||||
duration: "0:00:00",
|
duration: '0:00:00',
|
||||||
id: 87,
|
id: 87,
|
||||||
rating_status: "ok",
|
rating_status: 'ok',
|
||||||
start_time: "2018-06-21 15:02:41.762",
|
start_time: '2018-06-21 15:02:41.762',
|
||||||
status: "noanswer",
|
status: 'noanswer',
|
||||||
total_customer_cost: 0,
|
total_customer_cost: 0,
|
||||||
type: "call",
|
type: 'call',
|
||||||
_links: {
|
_links: {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
call_id: "8fe2fa2f-84bc-48be-977d-84984aa5cc29",
|
call_id: '8fe2fa2f-84bc-48be-977d-84984aa5cc29',
|
||||||
call_type: "call",
|
call_type: 'call',
|
||||||
callee: "43993006",
|
callee: '43993006',
|
||||||
caller: "43993004",
|
caller: '43993004',
|
||||||
currency: "",
|
currency: '',
|
||||||
customer_cost: 0,
|
customer_cost: 0,
|
||||||
direction: "out",
|
direction: 'out',
|
||||||
duration: "0:00:00",
|
duration: '0:00:00',
|
||||||
id: 85,
|
id: 85,
|
||||||
rating_status: "ok",
|
rating_status: 'ok',
|
||||||
start_time: "2018-06-21 14:50:00.687",
|
start_time: '2018-06-21 14:50:00.687',
|
||||||
status: "noanswer",
|
status: 'noanswer',
|
||||||
total_customer_cost: 0,
|
total_customer_cost: 0,
|
||||||
type: "call",
|
type: 'call',
|
||||||
_links: {
|
_links: {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
lastPage: 1
|
lastPage: 1
|
||||||
};
|
}
|
||||||
ConversationsModule.mutations.reloadItemsSucceeded(state, data);
|
ConversationsModule.mutations.reloadItemsSucceeded(state, data)
|
||||||
assert.deepEqual(state.items, data.items);
|
assert.deepEqual(state.items, data.items)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load blocked numbers and mode', function(){
|
it('should load blocked numbers and mode', function () {
|
||||||
let state = {
|
const state = {
|
||||||
blockedNumbersIncoming: new Set(),
|
blockedNumbersIncoming: new Set(),
|
||||||
blockedModeIncoming: null,
|
blockedModeIncoming: null,
|
||||||
blockedNumbersOutgoing: new Set(),
|
blockedNumbersOutgoing: new Set(),
|
||||||
blockedModeOutgoing: null
|
blockedModeOutgoing: null
|
||||||
};
|
}
|
||||||
let options = {
|
const options = {
|
||||||
blockAnonymous: undefined,
|
blockAnonymous: undefined,
|
||||||
enabled: undefined,
|
enabled: undefined,
|
||||||
list: [
|
list: [
|
||||||
"123456",
|
'123456',
|
||||||
"555555"
|
'555555'
|
||||||
]
|
]
|
||||||
};
|
}
|
||||||
let listSet = new Set(["123456", "555555"]);
|
const listSet = new Set(['123456', '555555'])
|
||||||
ConversationsModule.mutations.blockedIncomingSucceeded(state, options);
|
ConversationsModule.mutations.blockedIncomingSucceeded(state, options)
|
||||||
ConversationsModule.mutations.blockedOutgoingSucceeded(state, options);
|
ConversationsModule.mutations.blockedOutgoingSucceeded(state, options)
|
||||||
assert.deepEqual(state.blockedNumbersIncoming, listSet);
|
assert.deepEqual(state.blockedNumbersIncoming, listSet)
|
||||||
assert.equal(state.blockedModeIncoming, 'blacklist');
|
assert.equal(state.blockedModeIncoming, 'blacklist')
|
||||||
assert.deepEqual(state.blockedNumbersOutgoing, listSet);
|
assert.deepEqual(state.blockedNumbersOutgoing, listSet)
|
||||||
assert.equal(state.blockedModeOutgoing, 'blacklist');
|
assert.equal(state.blockedModeOutgoing, 'blacklist')
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,27 +1,25 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import SpeedDialModule from '../../src/store/speed-dial';
|
import SpeedDialModule from '../../src/store/speed-dial'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('SpeedDial', function(){
|
describe('SpeedDial', function () {
|
||||||
|
it('should load all assigned speed dial slots', function () {
|
||||||
it('should load all assigned speed dial slots', function(){
|
const state = {
|
||||||
let state = {
|
|
||||||
assignedSlots: []
|
assignedSlots: []
|
||||||
};
|
}
|
||||||
let data = [
|
const data = [
|
||||||
{
|
{
|
||||||
destination: "sip:111111@192.168.178.23",
|
destination: 'sip:111111@192.168.178.23',
|
||||||
slot: "*1"
|
slot: '*1'
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
destination: "sip:333333@192.168.178.23",
|
destination: 'sip:333333@192.168.178.23',
|
||||||
slot: "*3"
|
slot: '*3'
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
SpeedDialModule.mutations.speedDialSucceeded(state, data);
|
SpeedDialModule.mutations.speedDialSucceeded(state, data)
|
||||||
assert.deepEqual(state.assignedSlots, data);
|
assert.deepEqual(state.assignedSlots, data)
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,17 +1,16 @@
|
|||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import UserModule from '../../src/store/user';
|
import UserModule from '../../src/store/user'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('UserModule', ()=>{
|
describe('UserModule', () => {
|
||||||
|
it('should login', () => {
|
||||||
it('should login', ()=>{
|
var state = {}
|
||||||
var state = {};
|
|
||||||
UserModule.mutations.loginSucceeded(state, {
|
UserModule.mutations.loginSucceeded(state, {
|
||||||
jwt: 'abc123',
|
jwt: 'abc123',
|
||||||
subscriberId: 123
|
subscriberId: 123
|
||||||
});
|
})
|
||||||
assert.equal(state.jwt, 'abc123');
|
assert.equal(state.jwt, 'abc123')
|
||||||
assert.equal(state.subscriberId, '123');
|
assert.equal(state.subscriberId, '123')
|
||||||
});
|
})
|
||||||
});
|
})
|
||||||
|
@ -1,107 +1,104 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import VoiceboxModule from '../../src/store/voicebox';
|
import VoiceboxModule from '../../src/store/voicebox'
|
||||||
import localeEn from 'src/i18n/en.json'
|
import localeEn from 'src/i18n/en.json'
|
||||||
import { i18n } from '../../src/i18n';
|
import { i18n } from '../../src/i18n'
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
|
|
||||||
describe('Voicebox', function(){
|
describe('Voicebox', function () {
|
||||||
|
it('should load all voicebox settings into store', function () {
|
||||||
it('should load all voicebox settings into store', function(){
|
const state = {
|
||||||
let state = {
|
|
||||||
voiceboxSettingDelete: false,
|
voiceboxSettingDelete: false,
|
||||||
voiceboxSettingAttach: false,
|
voiceboxSettingAttach: false,
|
||||||
voiceboxSettingPin: '',
|
voiceboxSettingPin: '',
|
||||||
voiceboxSettingEmail: '',
|
voiceboxSettingEmail: ''
|
||||||
};
|
}
|
||||||
let settings = {
|
const settings = {
|
||||||
attach: true,
|
attach: true,
|
||||||
delete: false,
|
delete: false,
|
||||||
email: '',
|
email: '',
|
||||||
id: 123,
|
id: 123,
|
||||||
pin: 1234,
|
pin: 1234,
|
||||||
sms_number: ''
|
sms_number: ''
|
||||||
};
|
}
|
||||||
VoiceboxModule.mutations.loadSettingsSucceeded(state, settings);
|
VoiceboxModule.mutations.loadSettingsSucceeded(state, settings)
|
||||||
assert.equal(state.voiceboxSettingDelete, settings.delete);
|
assert.equal(state.voiceboxSettingDelete, settings.delete)
|
||||||
assert.equal(state.voiceboxSettingAttach, settings.attach);
|
assert.equal(state.voiceboxSettingAttach, settings.attach)
|
||||||
assert.equal(state.voiceboxSettingEmail, settings.email);
|
assert.equal(state.voiceboxSettingEmail, settings.email)
|
||||||
assert.equal(state.voiceboxSettingPin, settings.pin);
|
assert.equal(state.voiceboxSettingPin, settings.pin)
|
||||||
|
})
|
||||||
});
|
|
||||||
|
|
||||||
it('should load all busy greeting id into store', function(){
|
it('should load all busy greeting id into store', function () {
|
||||||
let state = {
|
const state = {
|
||||||
busyGreetingId: null
|
busyGreetingId: null
|
||||||
};
|
}
|
||||||
let greetings = [
|
const greetings = [
|
||||||
{
|
{
|
||||||
id: 1
|
id: 1
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
VoiceboxModule.mutations.loadBusyGreetingSucceeded(state, greetings);
|
VoiceboxModule.mutations.loadBusyGreetingSucceeded(state, greetings)
|
||||||
assert.deepEqual(state.busyGreetingId, greetings[0].id);
|
assert.deepEqual(state.busyGreetingId, greetings[0].id)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load busy greeting id into store', function(){
|
it('should load busy greeting id into store', function () {
|
||||||
let state = {
|
const state = {
|
||||||
busyGreetingId: null
|
busyGreetingId: null
|
||||||
};
|
}
|
||||||
let greetings = [
|
const greetings = [
|
||||||
{
|
{
|
||||||
id: 1
|
id: 1
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
VoiceboxModule.mutations.loadBusyGreetingSucceeded(state, greetings);
|
VoiceboxModule.mutations.loadBusyGreetingSucceeded(state, greetings)
|
||||||
assert.deepEqual(state.busyGreetingId, greetings[0].id);
|
assert.deepEqual(state.busyGreetingId, greetings[0].id)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load unavailable greeting id into store', function(){
|
it('should load unavailable greeting id into store', function () {
|
||||||
let state = {
|
const state = {
|
||||||
unavailGreetingId: null
|
unavailGreetingId: null
|
||||||
};
|
}
|
||||||
let greetings = [
|
const greetings = [
|
||||||
{
|
{
|
||||||
id: 1
|
id: 1
|
||||||
}
|
}
|
||||||
];
|
]
|
||||||
VoiceboxModule.mutations.loadUnavailGreetingSucceeded(state, greetings);
|
VoiceboxModule.mutations.loadUnavailGreetingSucceeded(state, greetings)
|
||||||
assert.deepEqual(state.unavailGreetingId, greetings[0].id);
|
assert.deepEqual(state.unavailGreetingId, greetings[0].id)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load busy greeting url into store', function(){
|
it('should load busy greeting url into store', function () {
|
||||||
let state = {
|
const state = {
|
||||||
playBusyGreetingUrl: null
|
playBusyGreetingUrl: null
|
||||||
};
|
}
|
||||||
let url = "blob:https://1.2.3.4/6341147c-3ed2-4112-876b-331e834a4821";
|
const url = 'blob:https://1.2.3.4/6341147c-3ed2-4112-876b-331e834a4821'
|
||||||
VoiceboxModule.mutations.playBusyGreetingSucceeded(state, url);
|
VoiceboxModule.mutations.playBusyGreetingSucceeded(state, url)
|
||||||
assert.deepEqual(state.playBusyGreetingUrl, url);
|
assert.deepEqual(state.playBusyGreetingUrl, url)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should load unavailable greeting id into store', function(){
|
it('should load unavailable greeting id into store', function () {
|
||||||
let state = {
|
const state = {
|
||||||
playUnavailGreetingUrl: null
|
playUnavailGreetingUrl: null
|
||||||
};
|
}
|
||||||
let url = "blob:https://1.2.3.4/6341147c-3ed2-4112-876b-331e834a4821";
|
const url = 'blob:https://1.2.3.4/6341147c-3ed2-4112-876b-331e834a4821'
|
||||||
VoiceboxModule.mutations.playUnavailGreetingSucceeded(state, url);
|
VoiceboxModule.mutations.playUnavailGreetingSucceeded(state, url)
|
||||||
assert.deepEqual(state.playUnavailGreetingUrl, url);
|
assert.deepEqual(state.playUnavailGreetingUrl, url)
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should get right label for busy greeting to indicate if it\'s custom or default', function(){
|
it('should get right label for busy greeting to indicate if it\'s custom or default', function () {
|
||||||
let state = {
|
const state = {
|
||||||
busyGreetingId: null
|
busyGreetingId: null
|
||||||
};
|
}
|
||||||
let getterObject = VoiceboxModule.getters.busyGreetingLabel(state);
|
const getterObject = VoiceboxModule.getters.busyGreetingLabel(state)
|
||||||
assert.equal(getterObject, i18n.t('voicebox.label.defaultSoundActive'));
|
assert.equal(getterObject, i18n.t('voicebox.label.defaultSoundActive'))
|
||||||
});
|
})
|
||||||
|
|
||||||
it('should get right label for unavailable greeting to indicate if it\'s custom or default', function(){
|
it('should get right label for unavailable greeting to indicate if it\'s custom or default', function () {
|
||||||
let state = {
|
const state = {
|
||||||
unavailGreetingId: 1
|
unavailGreetingId: 1
|
||||||
};
|
}
|
||||||
let getterObject = VoiceboxModule.getters.unavailGreetingLabel(state);
|
const getterObject = VoiceboxModule.getters.unavailGreetingLabel(state)
|
||||||
assert.equal(getterObject, i18n.t('voicebox.label.customSoundActive'));
|
assert.equal(getterObject, i18n.t('voicebox.label.customSoundActive'))
|
||||||
});
|
})
|
||||||
|
})
|
||||||
});
|
|
||||||
|
@ -1,74 +1,72 @@
|
|||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
import { isYesterday, isToday, isWithinLastWeek } from '../../src/helpers/date-helper'
|
import { isYesterday, isToday, isWithinLastWeek } from '../../src/helpers/date-helper'
|
||||||
|
|
||||||
describe('Date helper', function() {
|
describe('Date helper', function () {
|
||||||
|
it('should check whether a given date is yesterday or not', function () {
|
||||||
|
const today = new Date('2000-01-01 00:00:00')
|
||||||
|
const beforeYesterday = new Date('1999-12-30 00:00:00')
|
||||||
|
const tomorrow = new Date('2000-01-02 00:00:00')
|
||||||
|
|
||||||
it('should check whether a given date is yesterday or not', function() {
|
const yesterday1 = new Date('1999-12-31 00:00:00')
|
||||||
let today = new Date('2000-01-01 00:00:00');
|
const yesterday2 = new Date('1999-12-31 14:00:00')
|
||||||
let beforeYesterday = new Date('1999-12-30 00:00:00');
|
const yesterday3 = new Date('1999-12-31 23:59:59')
|
||||||
let tomorrow = new Date('2000-01-02 00:00:00');
|
|
||||||
|
|
||||||
let yesterday1 = new Date('1999-12-31 00:00:00');
|
assert.isTrue(isYesterday(yesterday1, today))
|
||||||
let yesterday2 = new Date('1999-12-31 14:00:00');
|
assert.isTrue(isYesterday(yesterday2, today))
|
||||||
let yesterday3 = new Date('1999-12-31 23:59:59');
|
assert.isTrue(isYesterday(yesterday3, today))
|
||||||
|
|
||||||
assert.isTrue(isYesterday(yesterday1, today));
|
assert.isFalse(isYesterday(beforeYesterday, today))
|
||||||
assert.isTrue(isYesterday(yesterday2, today));
|
assert.isFalse(isYesterday(today, today))
|
||||||
assert.isTrue(isYesterday(yesterday3, today));
|
assert.isFalse(isYesterday(tomorrow, today))
|
||||||
|
})
|
||||||
|
|
||||||
assert.isFalse(isYesterday(beforeYesterday, today));
|
it('should check whether a given date is today or not', function () {
|
||||||
assert.isFalse(isYesterday(today, today));
|
const today = new Date('2000-01-01 00:00:00')
|
||||||
assert.isFalse(isYesterday(tomorrow, today));
|
const yesterday = new Date('1999-12-31 00:00:00')
|
||||||
});
|
const beforeYesterday = new Date('1999-12-30 00:00:00')
|
||||||
|
const tomorrow = new Date('2000-01-02 00:00:00')
|
||||||
|
const afterTomorrow = new Date('2000-01-03 00:00:00')
|
||||||
|
|
||||||
it('should check whether a given date is today or not', function() {
|
const today1 = new Date('2000-01-01 00:00:00')
|
||||||
let today = new Date('2000-01-01 00:00:00');
|
const today2 = new Date('2000-01-01 14:00:00')
|
||||||
let yesterday = new Date('1999-12-31 00:00:00');
|
const today3 = new Date('2000-01-01 23:59:59')
|
||||||
let beforeYesterday = new Date('1999-12-30 00:00:00');
|
|
||||||
let tomorrow = new Date('2000-01-02 00:00:00');
|
|
||||||
let afterTomorrow = new Date('2000-01-03 00:00:00');
|
|
||||||
|
|
||||||
let today1 = new Date('2000-01-01 00:00:00');
|
assert.isTrue(isToday(today, today))
|
||||||
let today2 = new Date('2000-01-01 14:00:00');
|
assert.isTrue(isToday(today1, today))
|
||||||
let today3 = new Date('2000-01-01 23:59:59');
|
assert.isTrue(isToday(today2, today))
|
||||||
|
assert.isTrue(isToday(today3, today))
|
||||||
|
|
||||||
assert.isTrue(isToday(today, today));
|
assert.isFalse(isToday(beforeYesterday, today))
|
||||||
assert.isTrue(isToday(today1, today));
|
assert.isFalse(isToday(yesterday, today))
|
||||||
assert.isTrue(isToday(today2, today));
|
assert.isFalse(isToday(tomorrow, today))
|
||||||
assert.isTrue(isToday(today3, today));
|
assert.isFalse(isToday(afterTomorrow, today))
|
||||||
|
})
|
||||||
|
|
||||||
assert.isFalse(isToday(beforeYesterday, today));
|
it('should check whether a given date is within last week or not', function () {
|
||||||
assert.isFalse(isToday(yesterday, today));
|
const today = new Date('2000-01-01 00:00:00')
|
||||||
assert.isFalse(isToday(tomorrow, today));
|
const validDay1 = new Date('1999-12-31 00:00:00')
|
||||||
assert.isFalse(isToday(afterTomorrow, today));
|
const validDay2 = new Date('1999-12-30 00:00:00')
|
||||||
});
|
const validDay3 = new Date('1999-12-29 00:00:00')
|
||||||
|
const validDay4 = new Date('1999-12-28 00:00:00')
|
||||||
|
const validDay5 = new Date('1999-12-27 00:00:00')
|
||||||
|
const validDay6 = new Date('1999-12-26 00:00:00')
|
||||||
|
|
||||||
it('should check whether a given date is within last week or not', function(){
|
const invalidDay1 = new Date('1999-12-25 00:00:00')
|
||||||
|
const invalidDay2 = new Date('1999-12-24 00:00:00')
|
||||||
|
const invalidDay3 = new Date('1999-12-23 00:00:00')
|
||||||
|
|
||||||
let today = new Date('2000-01-01 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay1, today))
|
||||||
let validDay1 = new Date('1999-12-31 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay2, today))
|
||||||
let validDay2 = new Date('1999-12-30 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay3, today))
|
||||||
let validDay3 = new Date('1999-12-29 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay4, today))
|
||||||
let validDay4 = new Date('1999-12-28 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay5, today))
|
||||||
let validDay5 = new Date('1999-12-27 00:00:00');
|
assert.isTrue(isWithinLastWeek(validDay6, today))
|
||||||
let validDay6 = new Date('1999-12-26 00:00:00');
|
|
||||||
|
|
||||||
let invalidDay1 = new Date('1999-12-25 00:00:00');
|
assert.isFalse(isWithinLastWeek(today, today))
|
||||||
let invalidDay2 = new Date('1999-12-24 00:00:00');
|
assert.isFalse(isWithinLastWeek(invalidDay1, today))
|
||||||
let invalidDay3 = new Date('1999-12-23 00:00:00');
|
assert.isFalse(isWithinLastWeek(invalidDay2, today))
|
||||||
|
assert.isFalse(isWithinLastWeek(invalidDay3, today))
|
||||||
assert.isTrue(isWithinLastWeek(validDay1, today));
|
})
|
||||||
assert.isTrue(isWithinLastWeek(validDay2, today));
|
})
|
||||||
assert.isTrue(isWithinLastWeek(validDay3, today));
|
|
||||||
assert.isTrue(isWithinLastWeek(validDay4, today));
|
|
||||||
assert.isTrue(isWithinLastWeek(validDay5, today));
|
|
||||||
assert.isTrue(isWithinLastWeek(validDay6, today));
|
|
||||||
|
|
||||||
assert.isFalse(isWithinLastWeek(today, today));
|
|
||||||
assert.isFalse(isWithinLastWeek(invalidDay1, today));
|
|
||||||
assert.isFalse(isWithinLastWeek(invalidDay2, today));
|
|
||||||
assert.isFalse(isWithinLastWeek(invalidDay3, today));
|
|
||||||
});
|
|
||||||
});
|
|
||||||
|
@ -1,61 +1,57 @@
|
|||||||
|
|
||||||
'use strict';
|
'use strict'
|
||||||
|
|
||||||
import { assert } from 'chai';
|
import { assert } from 'chai'
|
||||||
import {
|
import {
|
||||||
userInfo,
|
userInfo,
|
||||||
customMacAddress
|
customMacAddress
|
||||||
} from '../../src/helpers/validation'
|
} from '../../src/helpers/validation'
|
||||||
|
|
||||||
describe('Userinfo validation helper', function() {
|
describe('Userinfo validation helper', function () {
|
||||||
|
it('should validate userinfo consisting of phone number and country code', function () {
|
||||||
it('should validate userinfo consisting of phone number and country code', function() {
|
const input = '+439988776655'
|
||||||
let input = "+439988776655";
|
assert.isTrue(userInfo(input))
|
||||||
assert.isTrue(userInfo(input));
|
})
|
||||||
});
|
|
||||||
|
it('should validate userinfo with parameter', function () {
|
||||||
it('should validate userinfo with parameter', function() {
|
const input = '+358-555-1234567;postd=pp22'
|
||||||
let input = "+358-555-1234567;postd=pp22";
|
assert.isTrue(userInfo(input))
|
||||||
assert.isTrue(userInfo(input));
|
})
|
||||||
});
|
|
||||||
|
it('should validate userinfo consisting of subscriber username', function () {
|
||||||
it('should validate userinfo consisting of subscriber username', function() {
|
const input = 'alice'
|
||||||
let input = "alice";
|
assert.isTrue(userInfo(input))
|
||||||
assert.isTrue(userInfo(input));
|
})
|
||||||
});
|
|
||||||
|
it('should not validate invalid userinfo characters', function () {
|
||||||
it('should not validate invalid userinfo characters', function() {
|
const input = 'al)<e'
|
||||||
let input = "al)<e";
|
assert.isFalse(userInfo(input))
|
||||||
assert.isFalse(userInfo(input));
|
})
|
||||||
});
|
})
|
||||||
|
|
||||||
});
|
describe('Custom mac address validation helper', function () {
|
||||||
|
it('should validate mac address separated by colon', function () {
|
||||||
describe('Custom mac address validation helper', function() {
|
const input = '13:14:5f:cD:42:5f'
|
||||||
|
assert.isTrue(customMacAddress(input))
|
||||||
it('should validate mac address separated by colon', function() {
|
})
|
||||||
let input = "13:14:5f:cD:42:5f";
|
|
||||||
assert.isTrue(customMacAddress(input));
|
it('should validate mac address separated by hyphen', function () {
|
||||||
});
|
const input = '13-14-5f-cD-42-5f'
|
||||||
|
assert.isTrue(customMacAddress(input))
|
||||||
it('should validate mac address separated by hyphen', function() {
|
})
|
||||||
let input = "13-14-5f-cD-42-5f";
|
|
||||||
assert.isTrue(customMacAddress(input));
|
it('should validate mac address without separator', function () {
|
||||||
});
|
const input = '13145fcD425f'
|
||||||
|
assert.isTrue(customMacAddress(input))
|
||||||
it('should validate mac address without separator', function() {
|
})
|
||||||
let input = "13145fcD425f";
|
|
||||||
assert.isTrue(customMacAddress(input));
|
it('should not validate mac address with mixed separator', function () {
|
||||||
});
|
const input = '13:14:5f:cD:42-5f'
|
||||||
|
assert.isFalse(customMacAddress(input))
|
||||||
it('should not validate mac address with mixed separator', function() {
|
})
|
||||||
let input = "13:14:5f:cD:42-5f";
|
|
||||||
assert.isFalse(customMacAddress(input));
|
it('should not validate mac address when invalid', function () {
|
||||||
});
|
const input = 'k183p1r23411'
|
||||||
|
assert.isFalse(customMacAddress(input))
|
||||||
it('should not validate mac address when invalid', function() {
|
})
|
||||||
let input = "k183p1r23411";
|
})
|
||||||
assert.isFalse(customMacAddress(input));
|
|
||||||
});
|
|
||||||
|
|
||||||
});
|
|
||||||
|
Loading…
Reference in new issue