|
1 | 1 | from dash import Dash, Input, Output, dcc, html |
2 | 2 | from dash.exceptions import PreventUpdate |
3 | | -import json |
4 | | -import os |
5 | 3 | import pytest |
6 | 4 | from selenium.webdriver.common.by import By |
7 | 5 | from selenium.webdriver.support import expected_conditions as EC |
@@ -185,43 +183,4 @@ def on_click_update_graph(n_clicks): |
185 | 183 | time.sleep(1) |
186 | 184 | dash_dcc.percy_snapshot(f"Tabs-2 rendered ({is_eager})") |
187 | 185 |
|
188 | | - # do some extra tests while we're here |
189 | | - # and have access to Graph and plotly.js |
190 | | - check_graph_config_shape(dash_dcc) |
191 | | - |
192 | | - assert dash_dcc.get_logs() == [] |
193 | | - |
194 | | - |
195 | | -def check_graph_config_shape(dash_dcc): |
196 | | - config_schema = dash_dcc.driver.execute_script( |
197 | | - "return Plotly.PlotSchema.get().config;" |
198 | | - ) |
199 | | - with open(os.path.join(dcc.__path__[0], "metadata.json")) as meta: |
200 | | - graph_meta = json.load(meta)["src/components/Graph.react.js"] |
201 | | - config_prop_shape = graph_meta["props"]["config"]["type"]["value"] |
202 | | - |
203 | | - ignored_config = [ |
204 | | - "setBackground", |
205 | | - "showSources", |
206 | | - "logging", |
207 | | - "globalTransforms", |
208 | | - "notifyOnLogging", |
209 | | - "role", |
210 | | - "typesetMath", |
211 | | - ] |
212 | | - |
213 | | - def crawl(schema, props): |
214 | | - for prop_name in props: |
215 | | - assert prop_name in schema |
216 | | - |
217 | | - for item_name, item in schema.items(): |
218 | | - if item_name in ignored_config: |
219 | | - continue |
220 | | - |
221 | | - assert item_name in props |
222 | | - if "valType" not in item: |
223 | | - crawl(item, props[item_name]["value"]) |
224 | | - |
225 | | - crawl(config_schema, config_prop_shape) |
226 | | - |
227 | 186 | assert dash_dcc.get_logs() == [] |
0 commit comments