diff --git a/test/test_page.py b/test/test_page.py index 7923158a..e916603b 100644 --- a/test/test_page.py +++ b/test/test_page.py @@ -4,7 +4,7 @@ from typing import Iterable from pyecharts.charts import Bar, Line, Page from pyecharts.commons.utils import OrderedSet -from pyecharts.globals import ThemeType +from pyecharts.globals import ThemeType, CurrentConfig from pyecharts.components import Table from pyecharts import options as opts from pyecharts.faker import Faker @@ -173,3 +173,11 @@ class TestPageComponent(unittest.TestCase): with self.assertRaises(ValueError): page = Page() page.save_resize_html() + + def test_page_with_is_embed_js(self): + page = Page(layout=Page.SimplePageLayout, is_embed_js=True) + # Embedded JavaScript + content = page.render_embed() + self.assertNotIn( + CurrentConfig.ONLINE_HOST, content, "Embedding JavaScript fails" + ) diff --git a/test/test_series_options.py b/test/test_series_options.py index 7dbfe0dd..88c77bfb 100644 --- a/test/test_series_options.py +++ b/test/test_series_options.py @@ -2,12 +2,15 @@ import unittest from pyecharts.commons.utils import remove_key_with_none_value from pyecharts.options.series_options import ( + AnimationOpts, LabelOpts, ItemStyleOpts, MarkPointItem, MarkLineItem, + MarkLineOpts, MarkAreaItem, MarkAreaOpts, + MarkPointOpts, MinorTickOpts, MinorSplitLineOpts, TreeMapBreadcrumbOpts, @@ -174,3 +177,15 @@ class TestSeriesOptions(unittest.TestCase): def test_area_color_in_item_styles(self): op = ItemStyleOpts(area_color="red") self.assertEqual(op.opts["areaColor"], "red") + + def test_mark_point_opts_with_animation(self): + op = MarkPointOpts(animation_opts=AnimationOpts(animation=True)) + self.assertEqual(op.opts["animation"], True) + + def test_mark_line_opts_with_animation(self): + op = MarkLineOpts(animation_opts=AnimationOpts(animation=True)) + self.assertEqual(op.opts["animation"], True) + + def test_mark_area_opts_with_animation(self): + op = MarkAreaOpts(animation_opts=AnimationOpts(animation=True)) + self.assertEqual(op.opts["animation"], True)