From d46f59e4bed63860051dc38744bed664849621d2 Mon Sep 17 00:00:00 2001 From: Oleg Shchelykalnov Date: Sat, 27 Mar 2021 14:45:38 +0300 Subject: [PATCH] Add tests for PlotlyJS backend --- Project.toml | 3 ++- test/runtests.jl | 13 +++++++++++++ 2 files changed, 15 insertions(+), 1 deletion(-) diff --git a/Project.toml b/Project.toml index 234ef8aa1..a30170e58 100644 --- a/Project.toml +++ b/Project.toml @@ -63,6 +63,7 @@ Images = "916415d5-f1e6-5110-898d-aaa5f9f070e0" LibGit2 = "76f85450-5226-5b5a-8eaa-529ad045b433" OffsetArrays = "6fe1bfb0-de20-5000-8ca7-80f57d26f881" PGFPlotsX = "8314cec4-20b6-5062-9cdb-752b83310925" +PlotlyJS = "f0f68f2c-4968-5e81-91da-67840de0976a" RDatasets = "ce6b1742-4840-55fa-b093-852dadbb1d8b" StableRNGs = "860ef19b-820b-49d6-a774-d7a799459cd3" StaticArrays = "90137ffa-7385-5640-81b9-e52037218182" @@ -73,4 +74,4 @@ UnicodePlots = "b8865327-cd53-5732-bb35-84acbb429228" VisualRegressionTests = "34922c18-7c2a-561c-bac1-01e79b2c4c92" [targets] -test = ["Distributions", "FileIO", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "HDF5", "RDatasets", "StableRNGs", "StaticArrays", "StatsPlots", "Test", "TestImages", "UnicodePlots", "VisualRegressionTests"] +test = ["Distributions", "FileIO", "Gtk", "ImageMagick", "Images", "LibGit2", "OffsetArrays", "PGFPlotsX", "PlotlyJS", "HDF5", "RDatasets", "StableRNGs", "StaticArrays", "StatsPlots", "Test", "TestImages", "UnicodePlots", "VisualRegressionTests"] diff --git a/test/runtests.jl b/test/runtests.jl index 267974055..50c6b0437 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -139,6 +139,15 @@ const IMG_TOL = VERSION < v"1.4" && Sys.iswindows() ? 1e-1 : is_ci() ? 1e-2 : 1e @test isa(display(p), Nothing) == true end + @testset "PlotlyJS" begin + @test plotlyjs() == Plots.PlotlyJSBackend() + @test backend() == Plots.PlotlyJSBackend() + + p = plot(rand(10)) + @test isa(p, Plots.Plot) == true + @test_broken isa(display(p), Nothing) == true + end + end @testset "Axes" begin @@ -156,6 +165,10 @@ end end @testset "NoFail" begin + #ensure backend with tested display + @test unicodeplots() == Plots.UnicodePlotsBackend() + @test backend() == Plots.UnicodePlotsBackend() + plots = [histogram([1, 0, 0, 0, 0, 0]), plot([missing]), plot([missing; 1:4]),