Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

330 Fix integration test (update adtteSpec snapshott) #334

Merged
merged 4 commits into from
Sep 13, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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