Skip to content

Commit

Permalink
error in pca snapshot (#377)
Browse files Browse the repository at this point in the history
close #378 

add timeout before setting input to ensure that update is performed
correctly.

thank you for the review

Co-authored-by: benoit <benoit.falquet@roche.com>
  • Loading branch information
BFalquet and benoit committed Apr 8, 2024
1 parent 37fc2a6 commit f14e25d
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 9 deletions.
18 changes: 9 additions & 9 deletions tests/testthat/_snaps/pca.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

---

Expand Down
6 changes: 6 additions & 0 deletions tests/testthat/test-pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit f14e25d

Please sign in to comment.