-
Notifications
You must be signed in to change notification settings - Fork 547
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
test: add charts unit test cases (#244)
- Loading branch information
Showing
15 changed files
with
300 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestBoxPlotAssetsBeforeRender(t *testing.T) { | ||
boxPlot := NewBoxPlot() | ||
assert.Equal(t, []string{"echarts.min.js"}, boxPlot.JSAssets.Values) | ||
} | ||
|
||
func TestBoxPlotAssetsAfterRender(t *testing.T) { | ||
boxPlot := NewBoxPlot() | ||
err := boxPlot.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, boxPlot.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestEffectScatterAssetsBeforeRender(t *testing.T) { | ||
effectScatter := NewEffectScatter() | ||
assert.Equal(t, []string{"echarts.min.js"}, effectScatter.JSAssets.Values) | ||
} | ||
|
||
func TestEffectScatterAssetsAfterRender(t *testing.T) { | ||
effectScatter := NewEffectScatter() | ||
err := effectScatter.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, effectScatter.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestFunnelAssetsBeforeRender(t *testing.T) { | ||
funnel := NewFunnel() | ||
assert.Equal(t, []string{"echarts.min.js"}, funnel.JSAssets.Values) | ||
} | ||
|
||
func TestFunnelAssetsAfterRender(t *testing.T) { | ||
funnel := NewFunnel() | ||
err := funnel.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, funnel.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGaugeAssetsBeforeRender(t *testing.T) { | ||
gauge := NewGauge() | ||
assert.Equal(t, []string{"echarts.min.js"}, gauge.JSAssets.Values) | ||
} | ||
|
||
func TestGaugeAssetsAfterRender(t *testing.T) { | ||
gauge := NewGauge() | ||
err := gauge.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, gauge.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestGraphAssetsBeforeRender(t *testing.T) { | ||
graph := NewGraph() | ||
assert.Equal(t, []string{"echarts.min.js"}, graph.JSAssets.Values) | ||
} | ||
|
||
func TestGraphAssetsAfterRender(t *testing.T) { | ||
graph := NewGraph() | ||
err := graph.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, graph.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestHeatMapAssetsBeforeRender(t *testing.T) { | ||
heatMap := NewHeatMap() | ||
assert.Equal(t, []string{"echarts.min.js"}, heatMap.JSAssets.Values) | ||
} | ||
|
||
func TestHeatMapAssetsAfterRender(t *testing.T) { | ||
heatMap := NewHeatMap() | ||
err := heatMap.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, heatMap.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestLineAssetsBeforeRender(t *testing.T) { | ||
line := NewLine() | ||
assert.Equal(t, []string{"echarts.min.js"}, line.JSAssets.Values) | ||
} | ||
|
||
func TestLineAssetsAfterRender(t *testing.T) { | ||
line := NewLine() | ||
err := line.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, line.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestMapAssetsBeforeRender(t *testing.T) { | ||
Map := NewMap() | ||
assert.Equal(t, []string{"echarts.min.js"}, Map.JSAssets.Values) | ||
} | ||
|
||
func TestMapAssetsAfterRender(t *testing.T) { | ||
Map := NewMap() | ||
err := Map.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, Map.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestParallelAssetsBeforeRender(t *testing.T) { | ||
parallel := NewParallel() | ||
assert.Equal(t, []string{"echarts.min.js"}, parallel.JSAssets.Values) | ||
} | ||
|
||
func TestParallelAssetsAfterRender(t *testing.T) { | ||
parallel := NewParallel() | ||
err := parallel.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, parallel.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestRadarAssetsBeforeRender(t *testing.T) { | ||
radar := NewPie() | ||
assert.Equal(t, []string{"echarts.min.js"}, radar.JSAssets.Values) | ||
} | ||
|
||
func TestRadarAssetsAfterRender(t *testing.T) { | ||
radar := NewRadar() | ||
err := radar.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, radar.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestScatterAssetsBeforeRender(t *testing.T) { | ||
scatter := NewScatter() | ||
assert.Equal(t, []string{"echarts.min.js"}, scatter.JSAssets.Values) | ||
} | ||
|
||
func TestScatterAssetsAfterRender(t *testing.T) { | ||
scatter := NewScatter() | ||
err := scatter.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, scatter.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestSunburstAssetsBeforeRender(t *testing.T) { | ||
sunburst := NewSunburst() | ||
assert.Equal(t, []string{"echarts.min.js"}, sunburst.JSAssets.Values) | ||
} | ||
|
||
func TestSunburstAssetsAfterRender(t *testing.T) { | ||
sunburst := NewSunburst() | ||
err := sunburst.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, sunburst.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestThemeRiverAssetsBeforeRender(t *testing.T) { | ||
themeRiver := NewThemeRiver() | ||
assert.Equal(t, []string{"echarts.min.js"}, themeRiver.JSAssets.Values) | ||
} | ||
|
||
func TestThemeRiverAssetsAfterRender(t *testing.T) { | ||
themeRiver := NewThemeRiver() | ||
err := themeRiver.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, themeRiver.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTreeAssetsBeforeRender(t *testing.T) { | ||
tree := NewTree() | ||
assert.Equal(t, []string{"echarts.min.js"}, tree.JSAssets.Values) | ||
} | ||
|
||
func TestTreeAssetsAfterRender(t *testing.T) { | ||
tree := NewTree() | ||
err := tree.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, tree.JSAssets.Values) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
package charts | ||
|
||
import ( | ||
"io/ioutil" | ||
"testing" | ||
|
||
"github.com/stretchr/testify/assert" | ||
) | ||
|
||
func TestTreeMapAssetsBeforeRender(t *testing.T) { | ||
treeMap := NewTreeMap() | ||
assert.Equal(t, []string{"echarts.min.js"}, treeMap.JSAssets.Values) | ||
} | ||
|
||
func TestTreeMapAssetsAfterRender(t *testing.T) { | ||
treeMap := NewTreeMap() | ||
err := treeMap.Render(ioutil.Discard) | ||
assert.NoError(t, err) | ||
assert.Equal(t, []string{host + "echarts.min.js"}, treeMap.JSAssets.Values) | ||
} |