Skip to content

add more unit tests#680

Merged
donyunardi merged 7 commits into
mainfrom
more_unit_tests@main
May 28, 2026
Merged

add more unit tests#680
donyunardi merged 7 commits into
mainfrom
more_unit_tests@main

Conversation

@donyunardi
Copy link
Copy Markdown
Contributor

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

badge

Code Coverage Summary

Filename                        Stmts    Miss  Cover    Missing
----------------------------  -------  ------  -------  -------------------------------------------------------------------------------------------------------------------------
R/calls_combine_by.R                7       0  100.00%
R/choices_labeled.R                23       1  95.65%   34
R/count_labels.R                  126       0  100.00%
R/filter_panel_api.R               27       1  96.30%   132
R/FilteredData-utils.R             58       0  100.00%
R/FilteredData.R                  522      22  95.79%   109, 138, 186, 325, 397, 484-493, 514, 610-613, 657, 873
R/FilteredDataset-utils.R          23       1  95.65%   125
R/FilteredDataset.R               264       3  98.86%   49, 154, 189
R/FilteredDatasetDataframe.R      123       3  97.56%   87, 148, 158
R/FilteredDatasetDefault.R         18       0  100.00%
R/FilteredDatasetMAE.R            133      15  88.72%   56, 118-123, 160-165, 169-170
R/FilterPanelAPI.R                 10       0  100.00%
R/FilterState-utils.R             101       2  98.02%   264, 294
R/FilterState.R                   366      21  94.26%   91, 155, 266-267, 273-274, 328, 330, 416, 632, 675-679, 698, 762-768, 779
R/FilterStateChoices.R            354      10  97.18%   325, 448-451, 563-566, 611
R/FilterStateDate.R               221      46  79.19%   233, 361-371, 382-387, 391-396, 404-419, 438-445
R/FilterStateDatettime.R          316     125  60.44%   269, 389-530
R/FilterStateEmpty.R               53      22  58.49%   89, 100-104, 117, 146-162
R/FilterStateExpr.R                81       1  98.77%   244
R/FilterStateLogical.R            201      84  58.21%   139, 161, 221, 228, 248, 294-388
R/FilterStateRange.R              411     121  70.56%   264, 386, 497-504, 507-517, 520, 531-537, 548-560, 564-574, 578-580, 593-619, 634-641, 644-651, 665-682, 717-722, 732-734
R/FilterStates-utils.R             70       7  90.00%   108, 127, 188-194
R/FilterStates.R                  379      19  94.99%   63, 92-96, 208, 425, 470, 559-563, 608, 726-729
R/FilterStatesDF.R                  5       0  100.00%
R/FilterStatesMAE.R                10       1  90.00%   40
R/FilterStatesMatrix.R              7       0  100.00%
R/FilterStatesSE.R                171      47  72.51%   36, 73-75, 85-87, 119, 191-201, 213-223, 230-237, 245-252, 259
R/include_css_js.R                  5       0  100.00%
R/teal_slice.R                    108       1  99.07%   206
R/teal_slices.R                    88       5  94.32%   152-157
R/test_utils.R                     21       0  100.00%
R/utils.R                          29       0  100.00%
R/variable_types.R                 15       1  93.33%   48
R/zzz.R                            16      16  0.00%    3-46
TOTAL                            4362     575  86.82%

Diff against main

Filename                      Stmts    Miss  Cover
--------------------------  -------  ------  -------
R/FilteredData-utils.R            0     -17  +29.31%
R/FilteredData.R                  0     -96  +18.39%
R/FilteredDataset.R               0      -2  +0.76%
R/FilteredDatasetDefault.R        0      -4  +22.22%
R/FilterStateDatettime.R          0     -81  +25.63%
R/FilterStateEmpty.R              0      -9  +16.98%
R/FilterStateLogical.R            0     -65  +32.34%
TOTAL                             0    -274  +6.28%

Results for commit: d3fedb0

Minimum allowed coverage is 80%

♻️ This comment has been updated with latest results

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Unit Tests Summary

  1 files   32 suites   40s ⏱️
476 tests 461 ✅ 15 💤 0 ❌
978 runs  963 ✅ 15 💤 0 ❌

Results for commit d3fedb0.

♻️ This comment has been updated with latest results.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented May 21, 2026

Unit Test Performance Difference

Test Suite $Status$ Time on main $±Time$ $±Tests$ $±Skipped$ $±Failures$ $±Errors$
FilteredData-utils 👶 $+0.05$ $+16$ $0$ $0$ $0$
Additional test case details
Test Suite $Status$ Time on main $±Time$ Test Case
DatetimeFilterState 👶 $+0.02$ content_summary_omits_NA_span_when_data_has_no_NA_values
DatetimeFilterState 👶 $+0.02$ content_summary_shows_NA_check_icon_when_keep_na_is_NULL
DatetimeFilterState 👶 $+0.03$ content_summary_shows_NA_check_icon_when_keep_na_is_TRUE_and_NA_values_exist
DatetimeFilterState 👶 $+0.02$ content_summary_shows_NA_xmark_icon_when_keep_na_is_FALSE_and_NA_values_exist
DatetimeFilterState 👶 $+0.02$ content_summary_shows_datetime_range_in_summary_value_span
DatetimeFilterState 👶 $+0.02$ ui_inputs_applies_input_sm_class_to_both_pickers
DatetimeFilterState 👶 $+0.03$ ui_inputs_does_not_render_keep_NA_checkbox_when_no_NA_values_exist
DatetimeFilterState 👶 $+0.03$ ui_inputs_renders_a_to_separator_between_the_two_pickers
DatetimeFilterState 👶 $+0.03$ ui_inputs_renders_keep_NA_checkbox_when_NA_values_exist
DatetimeFilterState 👶 $+0.04$ ui_inputs_renders_start_and_end_datetime_pickers
DatetimeFilterState 👶 $+0.02$ ui_inputs_renders_start_and_end_reset_buttons
DatetimeFilterState 👶 $+0.03$ ui_inputs_renders_the_filter_datelike_input_layout_wrapper
DatetimeFilterState 👶 $+0.02$ ui_inputs_renders_the_timepicker_flag_in_the_picker_config
DefaultFilteredDataset 👶 $+0.00$ ui_active_returns_an_empty_div
DefaultFilteredDataset 👶 $+0.01$ ui_add_returns_an_empty_div
EmptyFilterState 👶 $+0.01$ EmptyFilterState_ui_inputs_renders_Keep_NA_checkbox_when_NA_values_exist
EmptyFilterState 👶 $+0.02$ EmptyFilterState_ui_inputs_renders_Variable_contains_missing_values_only_span
EmptyFilterState 👶 $+0.01$ EmptyFilterState_ui_inputs_renders_namespaced_keep_na_checkbox_input
EmptyFilterState 👶 $+0.02$ cache_state_raises_an_error_if_private_get_state_does_not_exist
EmptyFilterState 👶 $+0.02$ content_summary_returns_a_span_with_All_empty_text
FilteredData-utils 👶 $+0.01$ eval_expr_with_msg_error_message_includes_the_call_header_deparsed_call_and_original_error
FilteredData-utils 👶 $+0.00$ eval_expr_with_msg_evaluates_expression_into_the_provided_environment
FilteredData-utils 👶 $+0.01$ eval_expr_with_msg_returns_NULL_invisibly_on_successful_evaluation
FilteredData-utils 👶 $+0.00$ toggle_icon_two_way_JS_expression_calls_toggleClass_with_both_icon_classes_space_separated
FilteredData-utils 👶 $+0.00$ toggle_icon_two_way_JS_expression_interpolates_button_id_and_both_icon_classes_correctly
FilteredData-utils 👶 $+0.01$ toggle_icon_two_way_JS_expression_produces_JS_targeting_the_i_child_of_the_button
FilteredData-utils 👶 $+0.01$ toggle_title_two_way_JS_expression_interpolates_button_id_titles_1_and_titles_2_correctly
FilteredData-utils 👶 $+0.00$ toggle_title_two_way_JS_expression_produces_JS_that_stores_the_button_id_as_a_variable
FilteredData-utils 👶 $+0.00$ toggle_title_two_way_JS_expression_reads_the_current_title_into_a_variable
FilteredData-utils 👶 $+0.00$ toggle_title_two_way_JS_expression_sets_title_to_titles_2_when_current_title_matches_titles_1_
FilteredData 👶 $+0.04$ ui_active_renders_a_dataset_level_active_filter_panel_for_each_dataname
FilteredData 👶 $+0.05$ ui_active_returns_an_accordion_panel_with_expected_structure
FilteredData 👶 $+0.05$ ui_available_filters_renders_the_expected_structural_elements
FilteredData 👶 $+0.02$ ui_overview_returns_an_accordion_panel_with_expected_structure
LogicalFilterState 👶 $+0.02$ content_summary_omits_NA_span_when_data_has_no_NA_values
LogicalFilterState 👶 $+0.01$ content_summary_shows_FALSE_as_selected_value
LogicalFilterState 👶 $+0.02$ content_summary_shows_NA_check_icon_when_keep_na_is_NULL
LogicalFilterState 👶 $+0.02$ content_summary_shows_NA_check_icon_when_keep_na_is_TRUE_and_NA_values_exist
LogicalFilterState 👶 $+0.02$ content_summary_shows_NA_xmark_icon_when_keep_na_is_FALSE_and_NA_values_exist
LogicalFilterState 👶 $+0.03$ content_summary_shows_comma_separated_values_when_multiple_are_selected
LogicalFilterState 👶 $+0.01$ content_summary_shows_selected_value_in_summary_value_span
LogicalFilterState 👶 $+0.01$ is_any_filtered_returns_FALSE_when_one_value_in_data_selected_NA_kept
LogicalFilterState 👶 $+0.01$ is_any_filtered_returns_TRUE_when_both_logical_values_exist_in_the_data
LogicalFilterState 👶 $+0.01$ is_any_filtered_returns_TRUE_when_keep_na_is_FALSE_and_NA_values_exist
LogicalFilterState 👶 $+0.02$ ui_inputs_does_not_render_keep_NA_checkbox_when_no_NA_values_exist
LogicalFilterState 👶 $+0.03$ ui_inputs_renders_TRUE_and_FALSE_as_choice_labels
LogicalFilterState 👶 $+0.02$ ui_inputs_renders_keep_NA_checkbox_when_NA_values_exist
LogicalFilterState 👶 $+0.03$ ui_inputs_renders_radioButtons_when_multiple_is_FALSE
LogicalFilterState 👶 $+0.02$ ui_inputs_renders_the_expected_component_when_multiple_is_TRUE

Results for commit a249dc2

♻️ This comment has been updated with latest results.

@osenan osenan self-assigned this May 25, 2026
Copy link
Copy Markdown
Contributor

@osenan osenan left a comment

Choose a reason for hiding this comment

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

Good job! We have greatly improved the coverage, but I think some test can be simplified into one and some descriptions can be changed as well. In general is better not to include specific implementation in the description.

Comment thread tests/testthat/test-DatetimeFilterState.R Outdated
Comment thread tests/testthat/test-EmptyFilterState.R Outdated
Comment thread tests/testthat/test-EmptyFilterState.R Outdated
Comment thread tests/testthat/test-FilteredData-utils.R Outdated
Comment thread tests/testthat/test-FilteredData-utils.R Outdated
Comment thread R/zzz.R
Comment thread tests/testthat/test-FilteredData.R Outdated
Comment thread tests/testthat/test-LogicalFilterState.R Outdated
Comment thread tests/testthat/test-LogicalFilterState.R Outdated
Comment thread tests/testthat/test-LogicalFilterState.R Outdated
donyunardi and others added 3 commits May 26, 2026 15:24
Co-authored-by: Oriol Senan  <35930244+osenan@users.noreply.github.com>
Signed-off-by: Dony Unardi <donyunardi@gmail.com>
Co-authored-by: Oriol Senan  <35930244+osenan@users.noreply.github.com>
Signed-off-by: Dony Unardi <donyunardi@gmail.com>
@donyunardi donyunardi requested a review from osenan May 27, 2026 03:27
Copy link
Copy Markdown
Contributor

@osenan osenan left a comment

Choose a reason for hiding this comment

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

LGTM now!

@donyunardi donyunardi merged commit 4e0d917 into main May 28, 2026
29 checks passed
@donyunardi donyunardi deleted the more_unit_tests@main branch May 28, 2026 00:39
@github-actions github-actions Bot locked and limited conversation to collaborators May 28, 2026
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