From f14e25d79ab550fc8c37a90c01cb4a82a7f296fb Mon Sep 17 00:00:00 2001 From: b_falquet <64274616+BFalquet@users.noreply.github.com> Date: Mon, 8 Apr 2024 18:03:34 +0200 Subject: [PATCH] error in pca snapshot (#377) close #378 add timeout before setting input to ensure that update is performed correctly. thank you for the review Co-authored-by: benoit --- tests/testthat/_snaps/pca.md | 18 +++++++++--------- tests/testthat/test-pca.R | 6 ++++++ 2 files changed, 15 insertions(+), 9 deletions(-) diff --git a/tests/testthat/_snaps/pca.md b/tests/testthat/_snaps/pca.md index a3bee8c6..3158989b 100644 --- a/tests/testthat/_snaps/pca.md +++ b/tests/testthat/_snaps/pca.md @@ -44,15 +44,15 @@ cat(res) Output x y PANEL group shape colour size fill alpha stroke - 1 -0.68789565 0.04912578 1 -1 19 black 1.5 NA NA 0.5 - 2 -0.37824954 0.19209841 1 -1 19 black 1.5 NA NA 0.5 - 3 0.07502276 -0.31568702 1 -1 19 black 1.5 NA NA 0.5 - 4 0.33995282 -0.26532014 1 -1 19 black 1.5 NA NA 0.5 - 5 0.29004708 0.25038379 1 -1 19 black 1.5 NA NA 0.5 - 6 0.08718694 0.09422278 1 -1 19 black 1.5 NA NA 0.5 - 7 0.15015883 0.07932206 1 -1 19 black 1.5 NA NA 0.5 - 8 -0.05952522 -0.58893592 1 -1 19 black 1.5 NA NA 0.5 - 9 0.18330198 0.50479025 1 -1 19 black 1.5 NA NA 0.5 + 1 0.22531097 0.04912578 1 -1 19 black 1.5 NA NA 0.5 + 2 -0.32245662 0.19209841 1 -1 19 black 1.5 NA NA 0.5 + 3 0.19042723 -0.31568702 1 -1 19 black 1.5 NA NA 0.5 + 4 -0.12543919 -0.26532014 1 -1 19 black 1.5 NA NA 0.5 + 5 0.29815055 0.25038379 1 -1 19 black 1.5 NA NA 0.5 + 6 0.54809249 0.09422278 1 -1 19 black 1.5 NA NA 0.5 + 7 -0.06706013 0.07932206 1 -1 19 black 1.5 NA NA 0.5 + 8 -0.30521740 -0.58893592 1 -1 19 black 1.5 NA NA 0.5 + 9 -0.44180789 0.50479025 1 -1 19 black 1.5 NA NA 0.5 --- diff --git a/tests/testthat/test-pca.R b/tests/testthat/test-pca.R index 0c2115a7..8234442b 100644 --- a/tests/testthat/test-pca.R +++ b/tests/testthat/test-pca.R @@ -112,12 +112,18 @@ test_that("pca module works as expected in the test app", { # label option and matrix option. app$set_inputs(!!ns("tab_selected") := "PCA") app$set_inputs(!!ns("assay-name") := "rpkm") + app$wait_for_idle(timeout = 30000) # Important to ensure update of x_var. app$set_inputs(!!ns("x_var") := "3") app$set_inputs(!!ns("y_var") := "4") app$set_inputs(!!ns("var_pct") := FALSE) app$set_inputs(!!ns("label") := FALSE) app$wait_for_idle(timeout = 30000) + res <- app$get_value(input = ns("x_var")) + expect_identical(res, "3") + res <- app$get_value(input = ns("y_var")) + expect_identical(res, "4") + res <- app$get_value(output = ns("test_pca")) expect_snapshot( cat(res)