Skip to content
This repository was archived by the owner on Aug 29, 2025. It is now read-only.

Commit cf3dc6a

Browse files
byronbyronz
authored andcommitted
:white_label_check: start migrate new case
1 parent 11a7fcd commit cf3dc6a

File tree

4 files changed

+41
-45
lines changed

4 files changed

+41
-45
lines changed

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,9 @@
1717
"start": "webpack-serve ./webpack.serve.config.js --open",
1818
"lint": "eslint src tests",
1919
"lint:py": "flake8 --ignore=E501,F401,F841,F811 tests",
20-
"test": "run-s -c lint lint:py format:test test-unit test:py test:pyimport",
20+
"test": "run-s -c lint lint:py format:test test-unit test:py test:pyimport test:intg",
2121
"test:py": "pytest tests/test_integration.py",
22+
"test:intg": "pytest tests/integration",
2223
"test:pyimport": "pytest tests/test_dash_import.py",
2324
"test-unit": "jest",
2425
"format": "prettier --config .prettierrc --write src/**/*.js tests/unit/*.js",

tests/IntegrationTests.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ def setUpClass(cls):
3131
loader = percy.ResourceLoader(
3232
webdriver=cls.driver,
3333
base_url='/assets',
34-
root_dir='test/assets'
34+
root_dir='tests/assets'
3535
)
3636
cls.percy_runner = percy.Runner(loader=loader)
3737
cls.percy_runner.initialize_build()
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
import dash
2+
import dash_core_components as dcc
3+
import dash_html_components as html
4+
5+
6+
def test_upca001_upload_children_gallery(dash_duo):
7+
app = dash.Dash(__name__)
8+
app.layout = html.Div(
9+
[
10+
html.Div(id="waitfor"),
11+
html.Label("Empty"),
12+
dcc.Upload(),
13+
html.Label("Button"),
14+
dcc.Upload(html.Button("Upload File")),
15+
html.Label("Text"),
16+
dcc.Upload("Upload File"),
17+
html.Label("Link"),
18+
dcc.Upload(html.A("Upload File")),
19+
html.Label("Style"),
20+
dcc.Upload(
21+
["Drag and Drop or ", html.A("Select a File")],
22+
style={
23+
"width": "100%",
24+
"height": "60px",
25+
"lineHeight": "60px",
26+
"borderWidth": "1px",
27+
"borderStyle": "dashed",
28+
"borderRadius": "5px",
29+
"textAlign": "center",
30+
},
31+
),
32+
]
33+
)
34+
dash_duo.start_server(app)
35+
import time
36+
time.sleep(60)
37+
dash_duo.percy_snapshot("upca001 children gallery")

tests/integration/upload/test_upload_different_file_types.py

Lines changed: 1 addition & 43 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
def load_table(filetype, payload):
2020
df = (
2121
pd.read_csv(io.StringIO(base64.b64decode(payload).decode("utf-8")))
22-
if filetype == 'csv'
22+
if filetype == "csv"
2323
else pd.read_excel(io.BytesIO(base64.b64decode(payload)))
2424
)
2525

@@ -98,45 +98,3 @@ def update_output(contents):
9898
upload_div.send_keys(filepath)
9999
time.sleep(0.5)
100100
dash_duo.percy_snapshot(filepath)
101-
102-
103-
# def test_upload_gallery(self):
104-
# app = dash.Dash(__name__)
105-
# app.layout = html.Div([
106-
# html.Div(id='waitfor'),
107-
# html.Label('Empty'),
108-
# dcc.Upload(),
109-
110-
# html.Label('Button'),
111-
# dcc.Upload(html.Button('Upload File')),
112-
113-
# html.Label('Text'),
114-
# dcc.Upload('Upload File'),
115-
116-
# html.Label('Link'),
117-
# dcc.Upload(html.A('Upload File')),
118-
119-
# html.Label('Style'),
120-
# dcc.Upload([
121-
# 'Drag and Drop or ',
122-
# html.A('Select a File')
123-
# ], style={
124-
# 'width': '100%',
125-
# 'height': '60px',
126-
# 'lineHeight': '60px',
127-
# 'borderWidth': '1px',
128-
# 'borderStyle': 'dashed',
129-
# 'borderRadius': '5px',
130-
# 'textAlign': 'center'
131-
# })
132-
# ])
133-
# dash_duo.startServer(app)
134-
135-
# try:
136-
# dash_duo.wait_for_element_by_css_selector('#waitfor')
137-
# except Exception as e:
138-
# print(dash_duo.wait_for_element_by_css_selector(
139-
# '#_dash-app-content').get_attribute('innerHTML'))
140-
# raise e
141-
142-
# dash_duo.snapshot('test_upload_gallery')

0 commit comments

Comments
 (0)