wordpress-seo icon indicating copy to clipboard operation
wordpress-seo copied to clipboard

Add integration tests for the analytics adapter

Open leonidasmi opened this issue 9 months ago • 4 comments

Context

  • Adds integration tests for the analytics adapter

Summary

This PR can be summarized in the following changelog entry:

  • Adds integration tests for the analytics 4 adapter

Relevant technical choices:

  • Added the Site_Kit_Analytics_4_Adapter::set_analytics_4_module() and the Site_Kit_Analytics_4_Adapter::get_analytics_4_module() functions to facilitate testing - it shouldnt have an impact in the normal behavior of the class.

Test instructions

Test instructions for the acceptance test before the PR gets merged

This PR can be acceptance tested by following these steps:

  • Quickly Smoke test the organic sessions widget

Relevant test scenarios

  • [ ] Changes should be tested with the browser console open
  • [ ] Changes should be tested on different posts/pages/taxonomies/custom post types/custom taxonomies
  • [ ] Changes should be tested on different editors (Default Block/Gutenberg/Classic/Elementor/other)
  • [ ] Changes should be tested on different browsers
  • [ ] Changes should be tested on multisite

Test instructions for QA when the code is in the RC

  • [x] QA should use the same steps as above.

Impact check

This PR affects the following parts of the plugin, which may require extra testing:

UI changes

  • [ ] This PR changes the UI in the plugin. I have added the 'UI change' label to this PR.

Other environments

  • [ ] This PR also affects Shopify. I have added a changelog entry starting with [shopify-seo], added test instructions for Shopify and attached the Shopify label to this PR.

Documentation

  • [ ] I have written documentation for this change. For example, comments in the Relevant technical choices, comments in the code, documentation on Confluence / shared Google Drive / Yoast developer portal, or other.

Quality assurance

  • [x] I have tested this code to the best of my abilities.
  • [ ] During testing, I had activated all plugins that Yoast SEO provides integrations for.
  • [x] I have added unit tests to verify the code works as intended.
  • [ ] If any part of the code is behind a feature flag, my test instructions also cover cases where the feature flag is switched off.
  • [x] I have written this PR in accordance with my team's definition of done.
  • [x] I have checked that the base branch is correctly set.

Innovation

  • [ ] No innovation project is applicable for this PR.
  • [ ] This PR falls under an innovation project. I have attached the innovation label.
  • [ ] I have added my hours to the WBSO document.

Fixes https://github.com/Yoast/reserved-tasks/issues/481

leonidasmi avatar Mar 12 '25 13:03 leonidasmi

Pull Request Test Coverage Report for Build becfdad042b62ad2f0ae038e96b2a9cec4516f14

Warning: This coverage report may be inaccurate.

This pull request's base commit is no longer the HEAD commit of its target branch. This means it includes changes from outside the original pull request, including, potentially, unrelated coverage changes.

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.1%) to 54.946%

Totals Coverage Status
Change from base Build 18e587253363eab23879045deb60a6ca96e0d042: 0.1%
Covered Lines: 30825
Relevant Lines: 56556

💛 - Coveralls

coveralls avatar Mar 12 '25 13:03 coveralls

The test file names for is_connected and __construct should end with _Test. Also for is_connected please add a test to include this case: Screenshot 2025-03-18 at 15 25 45

vraja-pro avatar Mar 18 '25 13:03 vraja-pro

Also for is_connected please add a test to include this case

I'm not including a test for that case, because we're removing that function anyway here.

When that PR is merged, I'll go back and do the appropriate changes

leonidasmi avatar Apr 07 '25 13:04 leonidasmi

A merge conflict has been detected for the proposed code changes in this PR. Please resolve the conflict by either rebasing the PR or merging in changes from the base branch.

github-actions[bot] avatar Apr 10 '25 20:04 github-actions[bot]