Skip to content

Commit 1cad0aa

Browse files
committed
try fixing tests
1 parent 4cba17d commit 1cad0aa

File tree

7 files changed

+17
-11
lines changed

7 files changed

+17
-11
lines changed

NetworkDynamicsInspector/Project.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,7 @@ ElectronExt = ["Electron"]
2828
Bonito = "4.0.0"
2929
ColorSchemes = "3.29.0"
3030
Colors = "0.13.0"
31+
Electron = "6"
3132
GraphMakie = "0.5.14"
3233
Graphs = "1.12.0"
3334
NetworkDynamics = "0.9.13"

NetworkDynamicsInspector/src/NetworkDynamicsInspector.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ using NetworkDynamics: NetworkDynamics, SII, EIndex, VIndex, Network,
99
using Graphs: nv, ne
1010
using WGLMakie: WGLMakie
1111
using WGLMakie.Makie: Makie, @lift, MouseEvent, Point2f, with_theme,
12-
Cycle, lines!, vlines!, Theme, Figure, Colorbar, Axis,
12+
lines!, vlines!, Theme, Figure, Colorbar, Axis,
1313
xlims!, ylims!, autolimits!, hidespines!, hidedecorations!,
1414
register_interaction!, MouseEventTypes, Consume, events,
1515
mouseposition

NetworkDynamicsInspector/src/serving.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ function serve_app(s::ServerDisp, app)
4444
served_app = get(SERVER_STATE, :app, nothing)
4545

4646
if served_app !== app
47-
close_display(server)
47+
close_display(s)
4848
end
4949

5050
new_server = false

NetworkDynamicsInspector/test/Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ NetworkDynamicsInspector = {path = ".."}
2121
[compat]
2222
Aqua = "0.8.9"
2323
Bonito = "≥0.0.1"
24-
Electron = "6"
24+
Electron = "≥0.0.1"
2525
ExplicitImports = "1.10.1"
2626
Graphs = "≥0.0.1"
2727
NetworkDynamics = "≥0.0.1"

NetworkDynamicsInspector/test/multiselect_test.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,10 @@ using NetworkDynamicsInspector: OptionGroup, TomSelect
55
using NetworkDynamicsInspector: NetworkDynamicsInspector as NDI
66

77
function electron(app)
8-
close.(Electron.applications())
8+
try
9+
close.(Electron.applications())
10+
catch
11+
end
912
disp = Bonito.use_electron_display(devtools = true)
1013
display(disp, app)
1114
end

NetworkDynamicsInspector/test/runtests.jl

Lines changed: 5 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ end
7575

7676
@testset "Test simple app creation and add + remove of timeseries" begin
7777
sol = get_sol()
78-
inspect(sol; restart=true, reset=true, electron=true)
78+
inspect(sol; restart=true, reset=true, display=ElectronDisp())
7979

8080
delete!(NDI.APPSTATE[].tsplots[], "ts-1")
8181
notify(NDI.APPSTATE[].tsplots)
@@ -100,15 +100,15 @@ end
100100
notify(NDI.APPSTATE[].tsplots) # should update
101101
end
102102

103-
@testest "Test different display types" begin
103+
@testset "Test different display types" begin
104104
sol1 = get_sol()
105105
sol2 = get_sol(; limit = 1.2)
106106

107107
inspect(sol1; display=BrowserDisp(), restart=true, reset=true)
108108
# change observable
109109
empty!(NDI.APPSTATE[].tsplots[]); notify(NDI.APPSTATE[].tsplots)
110110
NDI.APPSTATE[].tsplots[]["ts-1"] = NDI.TimeseriesPlot(selcomp=[EIndex(i) for i in 1:7], states=[:P])
111-
notify(NDI.APPSTATE[].tsplots)
111+
# notify(NDI.APPSTATE[].tsplots) # does not work wihtout display
112112
inspect(sol2) # this should update the plot
113113
inspect(sol2, reset=true)
114114

@@ -121,11 +121,11 @@ end
121121
inspect(sol2) # this should update the plot
122122

123123
# switch to server
124-
inspect(sol1; display=ServerDisp())
124+
inspect(sol1; display=ServerDisp(), restart=true)
125125
@test NDI.BROWSER_STATE[:handler] == nothing
126126
empty!(NDI.APPSTATE[].tsplots[]); notify(NDI.APPSTATE[].tsplots)
127127
NDI.APPSTATE[].tsplots[]["ts-1"] = NDI.TimeseriesPlot(selcomp=[EIndex(i) for i in 1:7], states=[:P])
128-
notify(NDI.APPSTATE[].tsplots)
128+
# notify(NDI.APPSTATE[].tsplots) # does not work without session open
129129
inspect(sol2) # this should update the plot
130130
end
131131

@@ -134,4 +134,3 @@ end
134134
@safetestset "Slider Tests" begin include("slider_test.jl") end
135135
end
136136
end
137-

NetworkDynamicsInspector/test/slider_test.jl

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,10 @@ using NetworkDynamicsInspector
44
using NetworkDynamicsInspector: ContinuousSlider, RoundedLabel
55

66
function electron(app)
7-
close.(Electron.applications())
7+
try
8+
close.(Electron.applications())
9+
catch
10+
end
811
disp = Bonito.use_electron_display(devtools = true)
912
display(disp, app)
1013
end

0 commit comments

Comments
 (0)