Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
x649585723
incubator-echarts
提交
68f2a55b
I
incubator-echarts
项目概览
x649585723
/
incubator-echarts
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
I
incubator-echarts
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
68f2a55b
编写于
3月 31, 2021
作者:
P
pissang
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
test: fix ut
上级
4933a8ea
变更
8
隐藏空白更改
内联
并排
Showing
8 changed file
with
304 addition
and
299 deletion
+304
-299
test/ut/spec/component/graphic/setOption.test.ts
test/ut/spec/component/graphic/setOption.test.ts
+3
-3
test/ut/spec/component/visualMap/setOption.test.ts
test/ut/spec/component/visualMap/setOption.test.ts
+4
-4
test/ut/spec/data/dataTransform.test.ts
test/ut/spec/data/dataTransform.test.ts
+6
-6
test/ut/spec/model/Component.test.ts
test/ut/spec/model/Component.test.ts
+0
-235
test/ut/spec/model/Global.test.ts
test/ut/spec/model/Global.test.ts
+28
-28
test/ut/spec/model/componentDependency.test.ts
test/ut/spec/model/componentDependency.test.ts
+240
-0
test/ut/spec/model/timelineMediaOptions.test.ts
test/ut/spec/model/timelineMediaOptions.test.ts
+22
-22
test/ut/spec/series/custom.test.ts
test/ut/spec/series/custom.test.ts
+1
-1
未找到文件。
test/ut/spec/component/graphic/setOption.test.ts
浏览文件 @
68f2a55b
...
...
@@ -21,10 +21,10 @@ import { createChart, getGraphicElements, getECModel } from '../../../core/utHel
// import { imageURI } from './setOptionImageURI';
import
{
EChartsType
}
from
'
../../../../../src/echarts
'
;
import
Element
from
'
zrender/src/Element
'
;
import
{
ECharts
FullOption
}
from
'
../../../../../src
/option
'
;
import
{
ECharts
Option
}
from
'
../../../../../src/export
/option
'
;
import
{
GraphicComponentOption
,
GraphicComponentImageOption
}
from
'
../../../../../src/component/graphic
'
;
}
from
'
../../../../../src/component/graphic
/install
'
;
import
Group
from
'
zrender/src/graphic/Group
'
;
import
{
Dictionary
}
from
'
zrender/src/core/types
'
;
...
...
@@ -1049,7 +1049,7 @@ describe('graphic_setOption', function () {
describe
(
'
boundingAndRotation
'
,
function
()
{
function
getOption
():
ECharts
Full
Option
{
function
getOption
():
EChartsOption
{
return
{
legend
:
{
data
:
[
'
高度(km)与气温(°C)变化关系
'
]
...
...
test/ut/spec/component/visualMap/setOption.test.ts
浏览文件 @
68f2a55b
...
...
@@ -20,7 +20,7 @@
import
{
createChart
,
getECModel
}
from
'
../../../core/utHelper
'
;
import
{
EChartsType
}
from
'
../../../../../src/echarts
'
;
import
{
ECharts
FullOption
}
from
'
../../../../../src
/option
'
;
import
{
ECharts
Option
}
from
'
../../../../../src/export
/option
'
;
import
{
ContinousVisualMapOption
}
from
'
../../../../../src/component/visualMap/ContinuousModel
'
;
import
{
PiecewiseVisualMapOption
}
from
'
../../../../../src/component/visualMap/PiecewiseModel
'
;
import
VisualMapModel
from
'
../../../../../src/component/visualMap/VisualMapModel
'
;
...
...
@@ -94,15 +94,15 @@ describe('vsiaulMap_setOption', function () {
visualMap
:
{}
});
expectTheSame
(
chart
.
getOption
());
expectTheSame
(
chart
.
getOption
()
as
EChartsOption
);
chart
.
setOption
({
series
:
[{
data
:
[[
44
,
55
]]}]
// visualMap depends series
});
expectTheSame
(
chart
.
getOption
());
expectTheSame
(
chart
.
getOption
()
as
EChartsOption
);
function
expectTheSame
(
option
:
ECharts
Full
Option
)
{
function
expectTheSame
(
option
:
EChartsOption
)
{
const
visualMapOptionGotten
=
option
.
visualMap
as
(
ContinousVisualMapOption
|
PiecewiseVisualMapOption
)[];
expect
(
visualMapOptionGotten
.
length
).
toEqual
(
1
);
expect
(
visualMapOptionGotten
[
0
].
inRange
.
color
).
toEqual
([
'
red
'
,
'
blue
'
,
'
yellow
'
]);
...
...
test/ut/spec/data/dataTransform.test.ts
浏览文件 @
68f2a55b
...
...
@@ -19,7 +19,7 @@
import
{
EChartsType
}
from
'
../../../../src/echarts
'
;
import
{
createChart
,
removeChart
,
getECModel
}
from
'
../../core/utHelper
'
;
import
{
ECharts
FullOption
}
from
'
../../../../src
/option
'
;
import
{
ECharts
Option
}
from
'
../../../../src/export
/option
'
;
import
{
retrieveRawValue
}
from
'
../../../../src/data/helper/dataProvider
'
;
...
...
@@ -59,7 +59,7 @@ describe('dataTransform', function () {
}
it
(
'
forbid_seriesLayoutBy_row
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
dataset
:
[{
source
:
makeDatasetSourceDetection
(),
// This config should cause error thrown.
...
...
@@ -78,7 +78,7 @@ describe('dataTransform', function () {
});
it
(
'
seriesLayoutBy_changed_no_transform
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
dataset
:
{
source
:
makeDatasetSourceDetection
()
},
...
...
@@ -104,7 +104,7 @@ describe('dataTransform', function () {
]
}].
forEach
((
dataset1
,
itIdx
)
=>
{
it
(
`seriesLayoutBy_changed_transform_detection_
${
itIdx
}
`
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
dataset
:
[{
source
:
makeDatasetSourceDetection
()
},
dataset1
],
...
...
@@ -136,7 +136,7 @@ describe('dataTransform', function () {
}].
forEach
((
dataset1
,
itIdx
)
=>
{
it
(
`seriesLayoutBy_changed_transform_non_detection_
${
itIdx
}
`
,
function
()
{
const
sourceWrap
=
makeDatasetSourceNonDetectionByRow
();
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
dataset
:
[{
dimensions
:
sourceWrap
.
dimensions
,
source
:
sourceWrap
.
source
...
...
@@ -163,7 +163,7 @@ describe('dataTransform', function () {
]
}].
forEach
((
dataset1
,
itIdx
)
=>
{
it
(
`inherit_detected_dimensions_
${
itIdx
}
`
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
dataset
:
[{
source
:
makeDatasetSourceDetection
()
},
dataset1
],
...
...
test/ut/spec/model/Component.test.ts
已删除
100755 → 0
浏览文件 @
4933a8ea
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import
ComponentModel
,
{
ComponentModelConstructor
}
from
'
../../../../src/model/Component
'
;
import
{
ComponentMainType
}
from
'
../../../../src/util/types
'
;
const
componentModelConstructor
=
ComponentModel
as
ComponentModelConstructor
;
describe
(
'
Component
'
,
function
()
{
let
idx
=
0
;
function
makeTypes
(
count
:
number
):
string
[]
{
const
arr
=
[];
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
arr
.
push
(
'
type_
'
+
idx
++
);
}
return
arr
;
}
type
TopoResultItem
=
[
ComponentMainType
,
ComponentMainType
[]];
describe
(
'
topologicalTravel
'
,
function
()
{
it
(
'
topologicalTravel_base
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
});
componentModelConstructor
.
extend
({
type
:
a2
});
const
result
:
TopoResultItem
[]
=
[];
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_a1IsAbsent
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a2
});
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_empty
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
});
componentModelConstructor
.
extend
({
type
:
a2
});
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([]);
});
it
(
'
topologicalTravel_isolate
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
componentModelConstructor
.
extend
({
type
:
a2
});
componentModelConstructor
.
extend
({
type
:
a1
});
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a2
]});
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
a1
,
a2
,
m1
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a1
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a2
]]]);
});
it
(
'
topologicalTravel_diamond
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
]
=
makeTypes
(
4
);
componentModelConstructor
.
extend
({
type
:
a1
,
dependencies
:
[]});
componentModelConstructor
.
extend
({
type
:
a2
,
dependencies
:
[
a1
]});
componentModelConstructor
.
extend
({
type
:
a3
,
dependencies
:
[
a1
]});
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a2
,
a3
]});
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
,
a3
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a1
,
[
'
dataset
'
]],
[
a3
,
[
'
dataset
'
,
a1
]],
[
a2
,
[
'
dataset
'
,
a1
]],
[
m1
,
[
'
dataset
'
,
a2
,
a3
]]
]);
});
it
(
'
topologicalTravel_loop
'
,
function
()
{
const
[
m1
,
m2
,
a1
,
a2
,
a3
]
=
makeTypes
(
5
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
m2
,
dependencies
:
[
m1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
,
dependencies
:
[
m2
,
a2
,
a3
]});
componentModelConstructor
.
extend
({
type
:
a2
});
componentModelConstructor
.
extend
({
type
:
a3
});
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
expect
(
function
()
{
componentModelConstructor
.
topologicalTravel
(
[
m1
,
m2
,
a1
],
allList
,
()
=>
{}
);
}).
toThrowError
(
/Circl/
);
});
it
(
'
topologicalTravel_multipleEchartsInstance
'
,
function
()
{
const
[
m1
,
m2
,
a1
,
a2
]
=
makeTypes
(
4
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
});
componentModelConstructor
.
extend
({
type
:
a2
});
let
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
let
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
result
=
[];
componentModelConstructor
.
extend
({
type
:
m2
,
dependencies
:
[
a1
,
m1
]});
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m2
,
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]],
[
m2
,
[
'
dataset
'
,
a1
,
m1
]]]
);
});
it
(
'
topologicalTravel_missingSomeNodeButHasDependencies
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
,
a4
]
=
makeTypes
(
5
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a2
,
dependencies
:
[
a3
]});
componentModelConstructor
.
extend
({
type
:
a3
});
componentModelConstructor
.
extend
({
type
:
a4
});
let
result
:
TopoResultItem
[]
=
[];
let
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
a3
,
m1
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a3
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
,
a3
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
result
=
[];
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a3
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a3
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
,
a3
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_subType
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
,
a4
]
=
makeTypes
(
5
);
componentModelConstructor
.
extend
({
type
:
m1
,
dependencies
:
[
a1
,
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
+
'
.aaa
'
,
dependencies
:
[
a2
]});
componentModelConstructor
.
extend
({
type
:
a1
+
'
.bbb
'
,
dependencies
:
[
a3
,
a4
]});
componentModelConstructor
.
extend
({
type
:
a2
});
componentModelConstructor
.
extend
({
type
:
a3
});
componentModelConstructor
.
extend
({
type
:
a4
});
const
result
:
TopoResultItem
[]
=
[];
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
,
a4
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a4
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
,
a2
,
a3
,
a4
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]
]);
});
});
});
\ No newline at end of file
test/ut/spec/model/Global.test.ts
浏览文件 @
68f2a55b
...
...
@@ -24,7 +24,7 @@ import { ComponentMainType, ParsedValue } from '../../../../src/util/types';
import
SeriesModel
from
'
../../../../src/model/Series
'
;
import
ComponentModel
from
'
../../../../src/model/Component
'
;
import
ChartView
from
'
../../../../src/view/Chart
'
;
import
{
ECharts
FullOption
}
from
'
../../../../src
/option
'
;
import
{
ECharts
Option
}
from
'
../../../../src/export
/option
'
;
type
OriginModelView
=
{
model
:
SeriesModel
;
...
...
@@ -119,7 +119,7 @@ describe('modelAndOptionMapping', function () {
describe
(
'
idNoNameNo
'
,
function
()
{
it
(
'
sameTypeNotMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -239,7 +239,7 @@ describe('modelAndOptionMapping', function () {
describe
(
'
idSpecified
'
,
function
()
{
it
(
'
sameTypeNotMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -270,7 +270,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
sameTypeMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -293,7 +293,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeNotMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -307,7 +307,7 @@ describe('modelAndOptionMapping', function () {
chart
.
setOption
(
option
);
const
origins
=
saveOrigins
(
chart
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -328,7 +328,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeMergeFull
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -342,7 +342,7 @@ describe('modelAndOptionMapping', function () {
chart
.
setOption
(
option
);
const
origins
=
saveOrigins
(
chart
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
line
'
,
data
:
[
11
]},
{
type
:
'
bar
'
,
data
:
[
22
],
id
:
20
,
name
:
'
a
'
},
...
...
@@ -362,7 +362,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeMergePartial1
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -376,7 +376,7 @@ describe('modelAndOptionMapping', function () {
chart
.
setOption
(
option
);
const
origins
=
saveOrigins
(
chart
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
id
:
40
},
{
type
:
'
line
'
,
data
:
[
333
]},
...
...
@@ -399,7 +399,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeMergePartial2
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -409,7 +409,7 @@ describe('modelAndOptionMapping', function () {
};
chart
.
setOption
(
option
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
id
:
40
},
{
type
:
'
line
'
,
data
:
[
333
]},
...
...
@@ -429,7 +429,7 @@ describe('modelAndOptionMapping', function () {
it
(
'
mergePartialDoNotMapToOtherId
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -439,7 +439,7 @@ describe('modelAndOptionMapping', function () {
};
chart
.
setOption
(
option
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
id
:
40
}
]
...
...
@@ -455,7 +455,7 @@ describe('modelAndOptionMapping', function () {
it
(
'
idDuplicate
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -524,7 +524,7 @@ describe('modelAndOptionMapping', function () {
describe
(
'
noIdButNameExists
'
,
function
()
{
it
(
'
sameTypeNotMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -558,7 +558,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
sameTypeMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -581,7 +581,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeNotMerge
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -595,7 +595,7 @@ describe('modelAndOptionMapping', function () {
chart
.
setOption
(
option
);
const
origins
=
saveOrigins
(
chart
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -616,7 +616,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeMergePartialOneMapTwo
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -630,7 +630,7 @@ describe('modelAndOptionMapping', function () {
chart
.
setOption
(
option
);
const
origins
=
saveOrigins
(
chart
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
id
:
40
},
{
type
:
'
line
'
,
data
:
[
333
]},
...
...
@@ -654,7 +654,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
differentTypeMergePartialTwoMapOne
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -664,7 +664,7 @@ describe('modelAndOptionMapping', function () {
};
chart
.
setOption
(
option
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
name
:
'
a
'
},
{
type
:
'
line
'
,
data
:
[
333
]},
...
...
@@ -684,7 +684,7 @@ describe('modelAndOptionMapping', function () {
it
(
'
mergePartialCanMapToOtherName
'
,
function
()
{
// Consider case: axis.name = 'some label', which can be overwritten.
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
series
:
[
...
...
@@ -694,7 +694,7 @@ describe('modelAndOptionMapping', function () {
};
chart
.
setOption
(
option
);
const
option2
:
ECharts
Full
Option
=
{
const
option2
:
EChartsOption
=
{
series
:
[
{
type
:
'
bar
'
,
data
:
[
444
],
name
:
40
},
{
type
:
'
bar
'
,
data
:
[
999
],
name
:
40
},
...
...
@@ -720,7 +720,7 @@ describe('modelAndOptionMapping', function () {
describe
(
'
ohters
'
,
function
()
{
it
(
'
aBugCase
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
series
:
[
{
type
:
'
pie
'
,
...
...
@@ -790,7 +790,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
color
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
backgroundColor
:
'
rgba(1,1,1,1)
'
,
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
...
...
@@ -812,7 +812,7 @@ describe('modelAndOptionMapping', function () {
});
it
(
'
innerId
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]},
yAxis
:
{},
toolbox
:
{
...
...
test/ut/spec/model/componentDependency.test.ts
0 → 100755
浏览文件 @
68f2a55b
/*
* Licensed to the Apache Software Foundation (ASF) under one
* or more contributor license agreements. See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership. The ASF licenses this file
* to you under the Apache License, Version 2.0 (the
* "License"); you may not use this file except in compliance
* with the License. You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing,
* software distributed under the License is distributed on an
* "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND, either express or implied. See the License for the
* specific language governing permissions and limitations
* under the License.
*/
import
ComponentModel
,
{
ComponentModelConstructor
}
from
'
../../../../src/model/Component
'
;
import
{
ComponentMainType
}
from
'
../../../../src/util/types
'
;
const
componentModelConstructor
=
ComponentModel
as
ComponentModelConstructor
;
function
extendModel
(
type
:
string
,
dependencies
?:
string
[])
{
class
SubModel
extends
ComponentModel
{
static
type
:
string
=
type
;
type
:
string
=
type
;
static
dependencies
=
dependencies
||
[];
};
ComponentModel
.
registerClass
(
SubModel
);
return
SubModel
;
}
describe
(
'
componentDependency
'
,
function
()
{
let
idx
=
0
;
function
makeTypes
(
count
:
number
):
string
[]
{
const
arr
=
[];
for
(
let
i
=
0
;
i
<
count
;
i
++
)
{
arr
.
push
(
'
type_
'
+
idx
++
);
}
return
arr
;
}
type
TopoResultItem
=
[
ComponentMainType
,
ComponentMainType
[]];
it
(
'
topologicalTravel_base
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a1
);
extendModel
(
a2
);
const
result
:
TopoResultItem
[]
=
[];
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_a1IsAbsent
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a2
);
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_empty
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a1
);
extendModel
(
a2
);
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([]);
});
it
(
'
topologicalTravel_isolate
'
,
function
()
{
const
[
m1
,
a1
,
a2
]
=
makeTypes
(
3
);
extendModel
(
a2
);
extendModel
(
a1
);
extendModel
(
m1
,
[
a2
]);
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
a1
,
a2
,
m1
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a1
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a2
]]]);
});
it
(
'
topologicalTravel_diamond
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
]
=
makeTypes
(
4
);
extendModel
(
a1
,
[]);
extendModel
(
a2
,
[
a1
]);
extendModel
(
a3
,
[
a1
]);
extendModel
(
m1
,
[
a2
,
a3
]);
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
const
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
,
a3
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a1
,
[
'
dataset
'
]],
[
a3
,
[
'
dataset
'
,
a1
]],
[
a2
,
[
'
dataset
'
,
a1
]],
[
m1
,
[
'
dataset
'
,
a2
,
a3
]]
]);
});
it
(
'
topologicalTravel_loop
'
,
function
()
{
const
[
m1
,
m2
,
a1
,
a2
,
a3
]
=
makeTypes
(
5
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
m2
,
[
m1
,
a2
]);
extendModel
(
a1
,
[
m2
,
a2
,
a3
]);
extendModel
(
a2
);
extendModel
(
a3
);
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
expect
(
function
()
{
componentModelConstructor
.
topologicalTravel
(
[
m1
,
m2
,
a1
],
allList
,
()
=>
{}
);
}).
toThrowError
(
/Circular/
);
});
it
(
'
topologicalTravel_multipleEchartsInstance
'
,
function
()
{
const
[
m1
,
m2
,
a1
,
a2
]
=
makeTypes
(
4
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a1
);
extendModel
(
a2
);
let
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
let
result
:
TopoResultItem
[]
=
[];
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
result
=
[];
extendModel
(
m2
,
[
a1
,
m1
]);
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m2
,
m1
,
a1
,
a2
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]],
[
m2
,
[
'
dataset
'
,
a1
,
m1
]]]
);
});
it
(
'
topologicalTravel_missingSomeNodeButHasDependencies
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
,
a4
]
=
makeTypes
(
5
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a2
,
[
a3
]);
extendModel
(
a3
);
extendModel
(
a4
);
let
result
:
TopoResultItem
[]
=
[];
let
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
a3
,
m1
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a3
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
,
a3
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
result
=
[];
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a3
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
([[
a3
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
,
a3
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]]);
});
it
(
'
topologicalTravel_subType
'
,
function
()
{
const
[
m1
,
a1
,
a2
,
a3
,
a4
]
=
makeTypes
(
5
);
extendModel
(
m1
,
[
a1
,
a2
]);
extendModel
(
a1
+
'
.aaa
'
,
[
a2
]);
extendModel
(
a1
+
'
.bbb
'
,
[
a3
,
a4
]);
extendModel
(
a2
);
extendModel
(
a3
);
extendModel
(
a4
);
const
result
:
TopoResultItem
[]
=
[];
const
allList
=
componentModelConstructor
.
getAllClassMainTypes
();
componentModelConstructor
.
topologicalTravel
(
[
m1
,
a1
,
a2
,
a4
],
allList
,
function
(
componentType
,
dependencies
)
{
result
.
push
([
componentType
,
dependencies
]);
}
);
expect
(
result
).
toEqual
(
[[
a4
,
[
'
dataset
'
]],
[
a2
,
[
'
dataset
'
]],
[
a1
,
[
'
dataset
'
,
a2
,
a3
,
a4
]],
[
m1
,
[
'
dataset
'
,
a1
,
a2
]]
]);
});
});
\ No newline at end of file
test/ut/spec/model/timelineMediaOptions.test.ts
浏览文件 @
68f2a55b
...
...
@@ -24,7 +24,7 @@ import { ParsedValue } from '../../../../src/util/types';
import
{
LegendOption
}
from
'
../../../../src/component/legend/LegendModel
'
;
import
TimelineModel
from
'
../../../../src/component/timeline/TimelineModel
'
;
import
{
createChart
,
getECModel
}
from
'
../../core/utHelper
'
;
import
{
ECharts
FullOption
}
from
'
../../../../src
/option
'
;
import
{
ECharts
Option
}
from
'
../../../../src/export
/option
'
;
describe
(
'
timelineMediaOptions
'
,
function
()
{
...
...
@@ -36,7 +36,7 @@ describe('timelineMediaOptions', function () {
return
getECModel
(
chart
).
getComponent
(
'
series
'
,
seriesIndex
)
as
SeriesModel
;
}
function
getLegendOption
(
chart
:
EChartsType
):
LegendOption
{
return
getECModel
(
chart
).
getComponent
(
'
legend
'
,
0
).
option
;
return
getECModel
(
chart
).
getComponent
(
'
legend
'
,
0
).
option
as
LegendOption
;
}
function
getTimelineComponent
(
chart
:
EChartsType
):
TimelineModel
{
return
getECModel
(
chart
).
getComponent
(
'
timeline
'
,
0
)
as
TimelineModel
;
...
...
@@ -60,7 +60,7 @@ describe('timelineMediaOptions', function () {
describe
(
'
parse_timeline_media_option
'
,
function
()
{
it
(
'
parse_media_has_baseOption_has_default
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
baseOption
:
{
xAxis
:
{
data
:
[
'
a
'
]
},
yAxis
:
{},
...
...
@@ -88,7 +88,7 @@ describe('timelineMediaOptions', function () {
});
it
(
'
parse_media_no_baseOption_has_default
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]
},
yAxis
:
{},
legend
:
{
left
:
10
},
...
...
@@ -112,7 +112,7 @@ describe('timelineMediaOptions', function () {
});
it
(
'
parse_media_no_baseOption_no_default
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
xAxis
:
{
data
:
[
'
a
'
]
},
yAxis
:
{},
legend
:
{
left
:
10
},
...
...
@@ -132,7 +132,7 @@ describe('timelineMediaOptions', function () {
});
it
(
'
parse_timeline_media_has_baseOption
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
baseOption
:
{
timeline
:
{
axisType
:
'
category
'
},
xAxis
:
{
data
:
[
'
a
'
]
},
...
...
@@ -166,13 +166,13 @@ describe('timelineMediaOptions', function () {
expect
(
getData0
(
chart
,
0
)).
toEqual
(
88
);
expect
(
getLegendOption
(
chart
).
left
).
toEqual
(
50
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
expect
(
getLegendOption
(
chart
).
left
).
toEqual
(
50
);
});
it
(
'
parse_timeline_media_no_baseOption
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
timeline
:
{
axisType
:
'
category
'
},
xAxis
:
{
data
:
[
'
a
'
]
},
yAxis
:
{},
...
...
@@ -202,13 +202,13 @@ describe('timelineMediaOptions', function () {
expect
(
getData0
(
chart
,
0
)).
toEqual
(
88
);
expect
(
getLegendOption
(
chart
).
left
).
toEqual
(
50
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
expect
(
getLegendOption
(
chart
).
left
).
toEqual
(
50
);
});
it
(
'
parse_timeline_has_baseOption
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
baseOption
:
{
timeline
:
{
axisType
:
'
category
'
},
xAxis
:
{
data
:
[
'
a
'
]
},
...
...
@@ -227,12 +227,12 @@ describe('timelineMediaOptions', function () {
expect
(
getLegendOption
(
chart
).
right
).
not
.
toEqual
(
123
);
expect
(
getTimelineComponent
(
chart
)
!=
null
).
toEqual
(
true
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
});
it
(
'
parse_timeline_has_baseOption_compat
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
timeline
:
{
axisType
:
'
category
'
},
baseOption
:
{
xAxis
:
{
data
:
[
'
a
'
]
},
...
...
@@ -251,12 +251,12 @@ describe('timelineMediaOptions', function () {
expect
(
getLegendOption
(
chart
).
right
).
not
.
toEqual
(
123
);
expect
(
getTimelineComponent
(
chart
)
!=
null
).
toEqual
(
true
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
});
it
(
'
parse_timeline_has_baseOption_compat
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
timeline
:
{
axisType
:
'
category
'
},
baseOption
:
{
xAxis
:
{
data
:
[
'
a
'
]
},
...
...
@@ -275,12 +275,12 @@ describe('timelineMediaOptions', function () {
expect
(
getLegendOption
(
chart
).
right
).
not
.
toEqual
(
123
);
expect
(
getTimelineComponent
(
chart
)
!=
null
).
toEqual
(
true
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
});
it
(
'
parse_timeline_no_baseOption
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
timeline
:
{
axisType
:
'
category
'
},
xAxis
:
{
data
:
[
'
a
'
]
},
yAxis
:
{},
...
...
@@ -296,7 +296,7 @@ describe('timelineMediaOptions', function () {
expect
(
getLegendOption
(
chart
).
right
).
not
.
toEqual
(
123
);
expect
(
getTimelineComponent
(
chart
)
!=
null
).
toEqual
(
true
);
chart
.
setOption
({
timeline
:
{
currentIndex
:
1
}
});
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
1
}
});
expect
(
getData0
(
chart
,
0
)).
toEqual
(
99
);
});
...
...
@@ -310,7 +310,7 @@ describe('timelineMediaOptions', function () {
describe
(
'
timeline_onceMore
'
,
function
()
{
it
(
'
timeline_setOptionOnceMore_baseOption
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
baseOption
:
{
timeline
:
{
axisType
:
'
category
'
,
...
...
@@ -344,7 +344,7 @@ describe('timelineMediaOptions', function () {
expect
(
getData0
(
chart
,
0
)).
toEqual
(
11
);
expect
(
getData0
(
chart
,
1
)).
toEqual
(
22
);
chart
.
setOption
({
chart
.
setOption
<
EChartsOption
>
({
xAxis
:
{
data
:
[
'
c
'
]},
timeline
:
{
currentIndex
:
1
...
...
@@ -358,7 +358,7 @@ describe('timelineMediaOptions', function () {
it
(
'
timeline_setOptionOnceMore_substitudeTimelineOptions
'
,
function
()
{
const
option
:
ECharts
Full
Option
=
{
const
option
:
EChartsOption
=
{
baseOption
:
{
timeline
:
{
axisType
:
'
category
'
,
...
...
@@ -416,7 +416,7 @@ describe('timelineMediaOptions', function () {
expect
(
getData0
(
chart
,
0
)).
toEqual
(
1111
);
expect
(
getData0
(
chart
,
1
)).
toEqual
(
2222
);
chart
.
setOption
({
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
0
}
...
...
@@ -425,7 +425,7 @@ describe('timelineMediaOptions', function () {
expect
(
getData0
(
chart
,
0
)).
toEqual
(
55
);
expect
(
getData0
(
chart
,
1
)).
toEqual
(
66
);
chart
.
setOption
({
chart
.
setOption
<
EChartsOption
>
({
timeline
:
{
currentIndex
:
2
}
...
...
test/ut/spec/series/custom.test.ts
浏览文件 @
68f2a55b
...
...
@@ -20,7 +20,7 @@
import
{
EChartsType
}
from
'
../../../../src/echarts
'
;
import
{
createChart
}
from
'
../../core/utHelper
'
;
import
{
ZRColor
}
from
'
../../../../src/util/types
'
;
import
{
CustomSeriesRenderItemAPI
,
CustomSeriesRenderItemParams
}
from
'
../../../../src/chart/custom
'
;
import
{
CustomSeriesRenderItemAPI
,
CustomSeriesRenderItemParams
}
from
'
../../../../src/chart/custom
/install
'
;
describe
(
'
custom_series
'
,
function
()
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录