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

Incrementally initializing the test apps so it becomes easier to review the tests. #1132

Closed
wants to merge 2 commits into from

Conversation

vedhav
Copy link
Contributor

@vedhav vedhav commented Apr 23, 2024

Part of #1108

@vedhav vedhav added the core label Apr 23, 2024
@m7pr
Copy link
Contributor

m7pr commented Apr 23, 2024

@vedhav we start the test description with a capital letter, and end with a dot

"e2e - tm_a_pca: Module is initialised with the specified defaults in function call."

@vedhav
Copy link
Contributor Author

vedhav commented Apr 23, 2024

App drivers are only initialized for 9/30 modules.
Hopefully after the app drivers are created and merged to main, it will be easier to start working on these apps and focus more of the energy on test specs.

@m7pr
Copy link
Contributor

m7pr commented Apr 23, 2024

@vedhav if there is one module only, do not use modules = teal::modules( in init_teal_app_driver but specify the module directly modules = tm_module_name

@m7pr
Copy link
Contributor

m7pr commented Apr 23, 2024

Hey, when it comes for the motivation why this PR is not necessary - I just started with tm_g_km module, and needed to review the driver anyway and found out that we can test few more parameters that are missing because there are some default values. bc9165a

@m7pr
Copy link
Contributor

m7pr commented Apr 23, 2024

I think you have tests/testthat/test-shinytest2-tm_g_forest_tte copy.R and tests/testthat/test-shinytest2-tm_g_forest_tte.R


testthat::expect_match(
app_driver$get_attr(
app_driver$active_module_element("myplot-plot_main > img"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is stupid but ui_g_adverse_events uses teal.widgets::plot_with_settings_ui(id = ns("chart"))

Suggested change
app_driver$active_module_element("myplot-plot_main > img"),
app_driver$active_module_element("chart-plot_main > img"),

Checkout the discussion about discrepancy in plot namespace name in here : ) insightsengineering/teal#1208 (comment)


testthat::expect_match(
app_driver$get_attr(
app_driver$active_module_element("myplot-plot_main > img"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Same reasoning as here https://github.com/insightsengineering/teal.modules.clinical/pull/1132/files#r1576318046

IMHO it would be better if we can go module by module, so we can focus on one module and catch such things.

Suggested change
app_driver$active_module_element("myplot-plot_main > img"),
app_driver$active_module_element("patient_timeline_plot-plot_main > img"),


testthat::expect_match(
app_driver$get_attr(
app_driver$active_module_element("myplot-plot_main > img"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
app_driver$active_module_element("myplot-plot_main > img"),
app_driver$active_module_element("therapy_plot-plot_main > img"),


testthat::expect_match(
app_driver$get_attr(
app_driver$active_module_element("myplot-plot_main > img"),
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
app_driver$active_module_element("myplot-plot_main > img"),
app_driver$active_module_element("vitals_plot-plot_main > img"),

@vedhav
Copy link
Contributor Author

vedhav commented May 6, 2024

Closing the PR as we have independent PRs raised

@vedhav vedhav closed this May 6, 2024
@github-actions github-actions bot locked and limited conversation to collaborators May 6, 2024
@insights-engineering-bot insights-engineering-bot deleted the 1108-shinytest2-init@main branch July 28, 2024 03:49
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants