Skip to content

Commit

Permalink
330 Fix integration test (update adtteSpec snapshott) (#334)
Browse files Browse the repository at this point in the history
closes
#330

changes in teal cause some tests to fail

thank you for the review

---------

Co-authored-by: benoit <[email protected]>
Co-authored-by: Daniel Sabanes Bove <[email protected]>
  • Loading branch information
3 people authored Sep 13, 2023
1 parent d2617cf commit f06a354
Show file tree
Hide file tree
Showing 23 changed files with 23 additions and 45 deletions.
39 changes: 0 additions & 39 deletions tests/testthat/_snaps/assaySpec.md

This file was deleted.

Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/km/km-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-001.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-002.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-003.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-007.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-008.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-009.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added tests/testthat/_snaps/windows-4.3/pca/pca-010.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
14 changes: 12 additions & 2 deletions tests/testthat/test-assaySpec.R
Original file line number Diff line number Diff line change
@@ -1,10 +1,20 @@
# assaySpecInput ----

test_that("assaySpecInput creates expected HTML", {
expect_snapshot(assaySpecInput(
expect_silent(result <- assaySpecInput(
"my_assay",
label_assays = "Please select the best assay"
label_assays = "select assay"
))

expect_class(result, "shiny.tag.list")
expect_length(result, 2)

# First element is a div tag
expect_tag(result[[1]])

# Second element is the contents of a single js file
expect_length(result[[2]], 1)
expect_tag(result[[2]][[1]])
})

# nolint start
Expand Down
15 changes: 11 additions & 4 deletions tests/testthat/test-pca.R
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,16 @@ test_that("pca module works as expected in the test app", {
# Add a gene filter and deselect everything and check that it does not crash.
app$set_inputs(!!ns2("add-MAE-hd1-row_to_add") := "symbol")
app$wait_for_idle()
app$set_inputs(!!ns2("active-MAE-hd1-MAE_symbol_hd1_subset-inputs-selection_open") := TRUE, allow_no_input_binding_ = TRUE)
app$set_inputs(!!ns2("active-MAE-hd1-MAE_symbol_hd1_subset-inputs-selection") := character())
app$set_inputs(!!ns2("active-MAE-hd1-MAE_symbol_hd1_subset-inputs-selection_open") := FALSE, allow_no_input_binding_ = TRUE)

app$wait_for_idle()
res <- app$get_value(output = ns("plot_pca-plot_main"))
expect_match(res$message, "No genes or samples included in this experiment, please adjust filters")

# Remove filters
app$click(ns2("add-MAE-hd1-MAE_symbol_hd1_subset-content-remove"))
app$click(ns2("active-MAE-hd1-MAE_symbol_hd1_subset-remove"))

# Update the tab selection.
app$set_inputs(!!ns("tab_selected") := "PC and Sample Correlation")
Expand Down Expand Up @@ -175,12 +178,16 @@ test_that("pca module works as expected in the test app", {

# Update to cor tab.
app$set_inputs(!!ns("tab_selected") := "PCA")
app$set_inputs(!!ns2("active-MAE-subjects-MAE_SEX-inputs-selection_open") := TRUE, allow_no_input_binding_ = TRUE)
app$set_inputs(!!ns2("active-MAE-subjects-MAE_SEX-inputs-selection") := "F")
res <- app$wait_for_value(output = ns("plot_pca"))
app$set_inputs(!!ns2("active-MAE-subjects-MAE_SEX-inputs-selection_open") := FALSE, allow_no_input_binding_ = TRUE)

app$wait_for_idle()
res <- app$get_value(output = ns("plot_pca-plot_main"))
expect_identical(res$message, "Sample size is too small. PCA needs more than 2 samples.")

# Remove filter.
app$click(ns2("MAE_filter-subjects-_var_SEX-remove"))
app$click(ns2("active-MAE-subjects-MAE_SEX-remove"))

# Initiate the use of Top Variance Genes filtering functionality.
app$set_inputs(!!ns("filter_top") := TRUE)
Expand Down Expand Up @@ -213,7 +220,7 @@ test_that("pca module works as expected in the test app", {
app$set_inputs(!!ns("experiment-name") := "hd1")
app$set_inputs(!!ns("filter_top") := "TRUE")
res <- app$wait_for_value(input = ns("n_top"))
expect_identical(res, 1000L)
expect_identical(res, 2500L)
})

# nolint end

0 comments on commit f06a354

Please sign in to comment.