1
0
mirror of https://gitlab.com/JKANetwork/CheckServer.git synced 2026-03-09 03:52:02 +01:00

Start again

This commit is contained in:
2020-10-04 17:14:00 +02:00
parent c0d3912413
commit 091f119048
4382 changed files with 1762543 additions and 9606 deletions

View File

@@ -0,0 +1,6 @@
require.config({
paths: {
'oldEcharts': 'tmp/oldEcharts',
'newEcharts': 'tmp/newEcharts'
}
});

View File

@@ -0,0 +1,586 @@
describe('legend', function() {
var uiHelper = window.uiHelper;
var suites = [{
name: 'show',
cases: [{
name: 'should display legend as default',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a']
}
}
}, {
name: 'should hide legend when show set to be false',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
show: false
}
}
}]
}, {
name: 'left',
cases: [{
name: 'should display left position',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: 'left'
}
}
}, {
name: 'should display at 20%',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: '20%'
}
}
}, {
name: 'should display at center',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: 'center'
}
}
}, {
name: 'should display at right',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: 'right'
}
}
}]
}, {
name: 'top',
cases: [{
name: 'should display top position',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: 50
}
}
}, {
name: 'should display at 20%',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: '20%'
}
}
}, {
name: 'should display at middle',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: 'middle'
}
}
}, {
name: 'should display at bottom',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: 'bottom'
}
}
}]
}, {
name: 'right',
cases: [{
name: 'should display right position',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
right: 50
}
}
}]
}, {
name: 'bottom',
cases: [{
name: 'should display bottom position',
option: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
bottom: 50
}
}
}]
}, {
name: 'left and right',
cases: [{
name: 'are both set',
test: 'equalOption',
option1: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: 50,
right: 50
}
},
option2: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
left: 50
}
}
}]
}, {
name: 'top and bottom',
cases: [{
name: 'are both set',
test: 'equalOption',
option1: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: 50,
bottom: 50
}
},
option2: {
series: [{
name: 'a',
type: 'line',
data: [1, 2, 4]
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['a'],
top: 50
}
}
}]
}, {
name: 'width',
cases: [{
name: 'should display in seperate lines',
test: 'notEqualOption',
option1: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
width: 200
}
},
option2: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c']
}
}
}]
}, {
name: 'hight',
cases: [{
name: 'should display in seperate lines',
test: 'notEqualOption',
option1: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
height: 50,
orient: 'vertical'
}
},
option2: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
orient: 'vertical'
}
}
}]
}, {
name: 'orient',
cases: [{
name: 'should display horizontally',
option: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
orient: 'horizontal'
}
}
}, {
name: 'should display vertically',
option: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
orient: 'vertical'
}
}
}, {
name: 'should display different with horizontal and vertical',
test: 'notEqualOption',
option1: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c'],
orient: 'vertical'
}
},
option2: {
series: [{
name: 'this is a',
type: 'line',
data: []
}, {
name: 'this is b',
type: 'line',
data: []
}, {
name: 'this is c',
type: 'line',
data: []
}],
xAxis : [{
type : 'category',
data : ['x','y','z']
}],
yAxis : [{
type : 'value'
}],
legend: {
data: ['this is a', 'this is b',
'this is c']
}
}
}]
}];
uiHelper.testOptionSpec('legend', suites);
});

434
vendors/echarts/test/ut/spec/ui/title.js vendored Normal file
View File

@@ -0,0 +1,434 @@
describe('title', function() {
var uiHelper = window.uiHelper;
var suites = [{
name: 'show',
cases: [{
name: 'should display given title by default',
option: {
series: [],
title: {
text: 'test title'
}
}
}, {
name: 'should hide title when show is false',
option: {
series: [],
title: {
text: 'hidden title',
display: false
}
}
}]
}, {
name: 'text',
cases: [{
name: 'should display title',
option: {
series: [],
title: {
text: 'here is a title'
}
}
}, {
name: 'should display long title in a line',
option: {
series: [],
title: {
text: 'here is a very long long long long long long long '
+ 'long long long long long long long long long long '
+ 'long long long long long long long long long title'
}
}
}, {
name: 'should run into a new line with \\n',
option: {
series: [],
title: {
text: 'first line\nsecond line'
}
}
}, {
name: 'should display no title by default',
option: {
series: []
}
}]
}, {
name: 'subtext',
cases: [{
name: 'should display subtext without text',
option: {
series: [],
title: {
subtext: 'subtext without text'
}
}
}, {
name: 'should display subtext with text',
option: {
series: [],
title: {
text: 'this is text',
subtext: 'subtext without text'
}
}
}]
}, {
name: 'padding',
cases: [{
name: 'should display padding 5px as default',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'this is title with 5px padding'
}
},
option2: {
series: [],
title: {
text: 'this is title with 5px padding',
padding: 5
}
}
}, {
name: 'should display one-value padding',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'should display one-value padding'
}
},
option2: {
series: [],
title: {
text: 'should display one-value padding',
padding: 50
}
}
}, {
name: 'should display two-value padding',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'display two-value padding'
}
},
option2: {
series: [],
title: {
text: 'display two-value padding',
padding: [20, 50]
}
}
}, {
name: 'should display four-value padding',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'compare padding with 10, 30, 50, 70'
}
},
option2: {
series: [],
title: {
text: 'compare padding with 10, 30, 50, 70',
padding: [10, 30, 50, 70]
}
}
}, {
name: 'should display four-value and two-value padding accordingly',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'compare padding with 20, 50 and 20, 50, 20, 50',
padding: [20, 50]
}
},
option2: {
series: [],
title: {
text: 'compare padding with 20, 50 and 20, 50, 20, 50',
padding: [20, 50, 20, 50]
}
}
}]
}, {
name: 'itemGap',
cases: [{
name: 'should have default itemGap as 5px',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'title',
subtext: 'subtext'
}
},
option2: {
series: [],
title: {
text: 'title',
subtext: 'subtext',
itemGap: 5
}
}
}]
}, {
name: 'left',
cases: [{
name: 'should display left position',
option: {
series: [],
title: {
text: 'this is title',
left: 50
}
}
}, {
name: 'should display at 20%',
option: {
series: [],
title: {
text: 'this is title',
left: '20%'
}
}
}, {
name: 'should display at center',
option: {
series: [],
title: {
text: 'this is title',
left: 'center'
}
}
}, {
name: 'should display at right',
option: {
series: [],
title: {
text: 'this is title',
left: 'right'
}
}
}]
}, {
name: 'top',
cases: [{
name: 'should display top position',
option: {
series: [],
title: {
text: 'this is title',
top: 50
}
}
}, {
name: 'should display at 20%',
option: {
series: [],
title: {
text: 'this is title',
top: '20%'
}
}
}, {
name: 'should display at middle',
option: {
series: [],
title: {
text: 'this is title',
top: 'middle'
}
}
}, {
name: 'should display at bottom',
option: {
series: [],
title: {
text: 'this is title',
top: 'bottom'
}
}
}]
}, {
name: 'right',
cases: [{
name: 'should display right position',
option: {
series: [],
title: {
text: 'this is title',
right: 50
}
}
}]
}, {
name: 'bottom',
cases: [{
name: 'should display bottom position',
option: {
series: [],
title: {
text: 'this is title',
bottom: 50
}
}
}]
}, {
name: 'left and right',
cases: [{
name: 'are both set',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'this is title',
left: 50,
right: 50
}
},
option2: {
series: [],
title: {
text: 'this is title',
left: 50
}
}
}]
}, {
name: 'top and bottom',
cases: [{
name: 'are both set',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'this is title',
top: 50,
bottom: 50
}
},
option2: {
series: [],
title: {
text: 'this is title',
top: 50
}
}
}]
}, {
name: 'backgroundColor',
cases: [{
name: 'should show specific background color',
option: {
series: [],
title: {
text: 'this is title',
backgroundColor: 'rgba(255, 100, 0, 0.2)'
}
}
}]
}, {
name: 'borderColor',
cases: [{
name: 'should show specific border color at default border width',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'this is title',
borderColor: '#f00'
}
},
option2: {
series: [],
title: {
text: 'this is title',
borderColor: '#f00',
borderWidth: 1
}
}
}, {
name: 'should display larger border width',
option: {
series: [],
title: {
text: 'this is title',
borderWidth: 15
}
}
}]
}, {
name: 'shadowBlur and shadowColor',
cases: [{
name: 'should display shadow blur',
option: {
series: [],
title: {
backgroundColor: 'green',
text: 'this is title',
shadowColor: 'red',
shadowBlur: 5
}
}
}]
}, {
name: 'shadowOffsetX',
cases: [{
name: 'should display shadow blur',
option: {
series: [],
title: {
backgroundColor: 'green',
text: 'this is title',
shadowColor: 'red',
shadowBlur: 5,
shadowOffsetX: 10
}
}
}]
}, {
name: 'shadowOffsetY',
cases: [{
name: 'should display shadow blur',
option: {
series: [],
title: {
backgroundColor: 'green',
text: 'this is title',
shadowColor: 'red',
shadowBlur: 5,
shadowOffsetY: 10
}
}
}]
}, {
name: 'shadowOffsetX and shadowOffsetY',
cases: [{
name: 'should display shadow blur',
option: {
series: [],
title: {
backgroundColor: 'green',
text: 'this is title',
shadowColor: 'red',
shadowBlur: 5,
shadowOffsetX: 10,
shadowOffsetY: 10
}
}
}]
}];
uiHelper.testOptionSpec('title', suites);
});

View File

@@ -0,0 +1,353 @@
describe('title.subtextStyle', function() {
var uiHelper = window.uiHelper;
var suites = [{
name: 'subtextStyle.color',
cases: [{
name: 'should display expected color name',
option: {
series: [],
title: {
subtext: 'a red subtitle',
subtextStyle: {
color: 'red'
}
}
}
}, {
name: 'should display expected color 6-digit hex',
option: {
series: [],
title: {
subtext: 'an orange subtitle',
subtextStyle: {
color: '#ff6600'
}
}
}
}, {
name: 'should display expected color 3-digit hex',
option: {
series: [],
title: {
subtext: 'an orange subtitle',
subtextStyle: {
color: '#f60'
}
}
}
}, {
name: 'should display expected color rgb',
option: {
series: [],
title: {
subtext: 'an orange subtitle',
subtextStyle: {
color: 'rgb(255, 127, 0)'
}
}
}
}, {
name: 'should display expected color rgba',
option: {
series: [],
title: {
subtext: 'an orange subtitle with alpha',
subtextStyle: {
color: 'rgba(255, 127, 0, 0.5)'
}
}
}
}]
}, {
name: 'subtextStyle.fontStyle',
cases: [{
name: 'should display normal font style',
option: {
series: [],
title: {
subtext: 'normal font',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display italic font style',
option: {
series: [],
title: {
subtext: 'italic font',
subtextStyle: {
fontStyle: 'italic'
}
}
}
}, {
name: 'should display oblique font style',
option: {
series: [],
title: {
subtext: 'oblique font',
subtextStyle: {
fontStyle: 'oblique'
}
}
}
}, {
name: 'should display italic not as normal',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'italic vs. normal',
subtextStyle: {
fontStyle: 'italic'
}
}
},
option2: {
series: [],
title: {
subtext: 'italic vs. normal',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display oblique not as normal',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'oblique vs. normal',
subtextStyle: {
fontStyle: 'oblique'
}
}
},
option2: {
series: [],
title: {
subtext: 'oblique vs. normal',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}]
}, {
name: 'subtextStyle.fontWeight',
cases: [{
name: 'should display default normal font weight',
test: 'equalOption',
option1: {
series: [],
title: {
subtext: 'normal font'
}
},
option2: {
series: [],
title: {
subtext: 'normal font',
subtextStyle: {
fontWeight: 'normal'
}
}
}
}, {
name: 'should display bold font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'bold font vs. normal font',
subtextStyle: {
fontStyle: 'bold'
}
}
},
option2: {
series: [],
title: {
subtext: 'bold font vs. normal font',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display bolder font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'bolder font vs. normal font',
subtextStyle: {
fontStyle: 'bolder'
}
}
},
option2: {
series: [],
title: {
subtext: 'bolder font vs. normal font',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display light font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'light font vs. normal font',
subtextStyle: {
fontStyle: 'light'
}
}
},
option2: {
series: [],
title: {
subtext: 'light font vs. normal font',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display numbering font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: '100 font vs. normal font',
subtextStyle: {
fontStyle: '100'
}
}
},
option2: {
series: [],
title: {
subtext: '100 font vs. normal font',
subtextStyle: {
fontStyle: 'normal'
}
}
}
}]
}, {
name: 'subtextStyle.fontFamily',
cases: [{
name: 'should display default fontFamily as sans-serif',
test: 'equalOption',
option1: {
series: [],
title: {
subtext: 'sans-serif'
}
},
option2: {
series: [],
title: {
subtext: 'sans-serif',
fontFamily: 'sans-serif'
}
}
}, {
name: 'should display default fontFamily as Arial',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'Arial vs. sans-serif',
subtextStyle: {
fontFamily: 'Arial'
}
}
},
option2: {
series: [],
title: {
subtext: 'Arial vs. sans-serif',
subtextStyle: {
fontFamily: 'sans-serif'
}
}
}
}]
}, {
name: 'textStyle.fontSize',
cases: [{
name: 'should display default fontSize at 18',
test: 'equalOption',
option1: {
series: [],
title: {
subtext: 'default font size, should be 18'
}
},
option2: {
series: [],
title: {
subtext: 'default font size, should be 18',
subtextStyle: {
fontSize: 18
}
}
}
}, {
name: 'should display larger fontSize',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'larger font size, 30',
subtextStyle: {
fontSize: 30
}
}
},
option2: {
series: [],
title: {
subtext: 'larger font size, 30',
subtextStyle: {
fontSize: 18
}
}
}
}, {
name: 'should display smaller fontSize',
test: 'notEqualOption',
option1: {
series: [],
title: {
subtext: 'smaller font size, 12',
subtextStyle: {
fontSize: 12
}
}
},
option2: {
series: [],
title: {
subtext: 'smaller font size, 12',
subtextStyle: {
fontSize: 18
}
}
}
}]
}];
uiHelper.testOptionSpec('title.subtextStyle', suites);
});

View File

@@ -0,0 +1,351 @@
describe('title.textStyle', function() {
var uiHelper = window.uiHelper;
var suites = [{
name: 'textStyle.color',
cases: [{
name: 'should display expected color name',
option: {
series: [],
title: {
text: 'a red title',
textStyle: {
color: 'red'
}
}
}
}, {
name: 'should display expected color 6-digit hex',
option: {
series: [],
title: {
text: 'an orange title',
textStyle: {
color: '#ff6600'
}
}
}
}, {
name: 'should display expected color 3-digit hex',
option: {
series: [],
title: {
text: 'an orange title',
textStyle: {
color: '#f60'
}
}
}
}, {
name: 'should display expected color rgb',
option: {
series: [],
title: {
text: 'an orange title',
textStyle: {
color: 'rgb(255, 127, 0)'
}
}
}
}, {
name: 'should display expected color rgba',
option: {
series: [],
title: {
text: 'an orange title with alpha',
textStyle: {
color: 'rgba(255, 127, 0, 0.5)'
}
}
}
}]
}, {
name: 'textStyle.fontStyle',
cases: [{
name: 'should display normal font style',
option: {
series: [],
title: {
text: 'normal font',
textStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display italic font style',
option: {
series: [],
title: {
text: 'italic font',
textStyle: {
fontStyle: 'italic'
}
}
}
}, {
name: 'should display oblique font style',
option: {
series: [],
title: {
text: 'oblique font',
textStyle: {
fontStyle: 'oblique'
}
}
}
}, {
name: 'should display italic not as normal',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'italic vs. normal',
textStyle: {
fontStyle: 'italic'
}
}
},
option2: {
series: [],
title: {
text: 'italic vs. normal',
textStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display oblique not as normal',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'oblique vs. normal',
textStyle: {
fontStyle: 'oblique'
}
}
},
option2: {
series: [],
title: {
text: 'oblique vs. normal',
textStyle: {
fontStyle: 'normal'
}
}
}
}]
}, {
name: 'textStyle.fontWeight',
cases: [{
name: 'should display default normal font weight',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'normal font'
}
},
option2: {
series: [],
title: {
text: 'normal font',
textStyle: {
fontWeight: 'normal'
}
}
}
}, {
name: 'should display bold font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'bold font vs. normal font',
textStyle: {
fontStyle: 'bold'
}
}
},
option2: {
series: [],
title: {
text: 'bold font vs. normal font',
textStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display bolder font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'bolder font vs. normal font',
textStyle: {
fontStyle: 'bolder'
}
}
},
option2: {
series: [],
title: {
text: 'bolder font vs. normal font',
textStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display light font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'light font vs. normal font',
textStyle: {
fontStyle: 'light'
}
}
},
option2: {
series: [],
title: {
text: 'light font vs. normal font',
textStyle: {
fontStyle: 'normal'
}
}
}
}, {
name: 'should display numbering font weight',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: '100 font vs. normal font',
textStyle: {
fontStyle: '100'
}
}
},
option2: {
series: [],
title: {
text: '100 font vs. normal font',
textStyle: {
fontStyle: 'normal'
}
}
}
}]
}, {
name: 'textStyle.fontFamily',
cases: [{
name: 'should display default fontFamily as sans-serif',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'sans-serif'
}
},
option2: {
series: [],
title: {
text: 'sans-serif',
fontFamily: 'sans-serif'
}
}
}, {
name: 'should display default fontFamily as Arial',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'Arial vs. sans-serif',
textStyle: {
fontFamily: 'Arial'
}
}
},
option2: {
series: [],
title: {
text: 'Arial vs. sans-serif',
fontFamily: 'sans-serif'
}
}
}]
}, {
name: 'textStyle.fontSize',
cases: [{
name: 'should display default fontSize at 18',
test: 'equalOption',
option1: {
series: [],
title: {
text: 'default font size, should be 18'
}
},
option2: {
series: [],
title: {
text: 'default font size, should be 18',
textStyle: {
fontSize: 18
}
}
}
}, {
name: 'should display larger fontSize',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'larger font size, 30',
textStyle: {
fontSize: 30
}
}
},
option2: {
series: [],
title: {
text: 'larger font size, 30',
textStyle: {
fontSize: 18
}
}
}
}, {
name: 'should display smaller fontSize',
test: 'notEqualOption',
option1: {
series: [],
title: {
text: 'smaller font size, 12',
textStyle: {
fontSize: 12
}
}
},
option2: {
series: [],
title: {
text: 'smaller font size, 12',
textStyle: {
fontSize: 18
}
}
}
}]
}];
uiHelper.testOptionSpec('title.textStyle', suites);
});