Skip to content

Commit aae3e20

Browse files
Test that defaults are not changed
1 parent 6946afc commit aae3e20

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

test/runtests.jl

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
11
using PlotlyLight
2+
using PlotlyLight.Defaults
23
using JSON3
34
using Test
45

@@ -12,6 +13,18 @@ using Test
1213
p(Config(x=1:10,y=rand(10)))
1314
@test length(p.data) == 2
1415
end
16+
#-----------------------------------------------------------------------------# defaults
17+
@testset "defaults" begin
18+
old_layout_default = copy(Defaults.layout[])
19+
old_config_default = copy(Defaults.config[])
20+
p = Plot()
21+
p.layout.xaxis.showgrid = false
22+
p.config.editable = true
23+
# make sure that mutation of layout and config of one plot has no effect on
24+
# global defaults
25+
@test Defaults.layout[] == old_layout_default
26+
@test Defaults.config[] == old_config_default
27+
end
1528
#-----------------------------------------------------------------------------# src
1629
@testset "src" begin
1730
p = Plot(Config(y=1:10))

0 commit comments

Comments
 (0)