Skip to content

Commit 4b07cab

Browse files
committed
add update_title integration tests
1 parent 49edf7e commit 4b07cab

File tree

4 files changed

+52
-0
lines changed

4 files changed

+52
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Dash
2+
using DashHtmlComponents
3+
4+
app = dash()
5+
app.layout = html_div(children = "Hello world!", id = "hello-div")
6+
run_server(app)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Dash
2+
using DashHtmlComponents
3+
4+
app = dash(;update_title = "... computing !")
5+
app.layout = html_div(children = "Hello world!", id = "hello-div")
6+
run_server(app)
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
using Dash
2+
using DashHtmlComponents
3+
4+
app = dash(;update_title = "")
5+
app.layout = html_div(children = "Hello world!", id = "hello-div")
6+
run_server(app)
Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
import os
2+
import pathlib
3+
4+
curr_path = pathlib.Path(__file__).parent.absolute()
5+
6+
7+
def boot(dashjl, filename):
8+
fp = os.path.join(curr_path, "jl_update_title", filename)
9+
dashjl.start_server(fp)
10+
dashjl.wait_for_text_to_equal(
11+
"#hello-div",
12+
"Hello world!"
13+
)
14+
15+
16+
def get_update_title_state(dashjl):
17+
return dashjl.driver.execute_script(
18+
"return store.getState().config.update_title"
19+
)
20+
21+
22+
def test_jltut001_update_title(dashjl):
23+
boot(dashjl, "jltut001_update_title.jl")
24+
assert get_update_title_state(dashjl) == "Updating..."
25+
26+
27+
def test_jltut002_update_title(dashjl):
28+
boot(dashjl, "jltut002_update_title.jl")
29+
assert get_update_title_state(dashjl) == "... computing !"
30+
31+
32+
def test_jltut003_update_title(dashjl):
33+
boot(dashjl, "jltut003_update_title.jl")
34+
assert get_update_title_state(dashjl) == ""

0 commit comments

Comments
 (0)