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

Update gathering data test helpers to use getSampleReportArgs(). #10104

Open
1 task
techanvil opened this issue Jan 23, 2025 · 1 comment
Open
1 task

Update gathering data test helpers to use getSampleReportArgs(). #10104

techanvil opened this issue Jan 23, 2025 · 1 comment
Assignees
Labels
P2 Low priority QA: Eng Requires specialized QA by an engineer Type: Infrastructure Engineering infrastructure & tooling

Comments

@techanvil
Copy link
Collaborator

techanvil commented Jan 23, 2025

Feature Description

At present, the provideAnalytics4GatheringDataState() and provideSearchConsoleGatheringDataState() helper functions are duplicating the report arguments used for the report that's used to determine the gathering data state.

We now have the getSampleReportArgs() helpers for both Analytics and Search Console in the plugin code, and should update the above test helpers to make use of getSampleReportArgs().


Do not alter or remove anything below. The following sections will be managed by moderators only.

Acceptance criteria

  • The provideAnalytics4GatheringDataState() and provideSearchConsoleGatheringDataState() helper functions should use getSampleReportArgs() to retrieve the arguments for the relevant reports, rather than duplicating the report args.

Implementation Brief

  • Update tests/js/gathering-data-utils.js:
    • Remove the function getAnalytics4HasZeroDataReportOptions, replace it's use with getSampleReportArgs imported from assets/js/modules/analytics-4/datastore/report.js.
    • Replace the following lines with a call to getSampleReportArgs imported from assets/js/modules/search-console/datastore/report.js:
      • const url = registry.select( CORE_SITE ).getCurrentEntityURL();
        const { compareStartDate: startDate, endDate } = registry
        .select( CORE_USER )
        .getDateRangeDates( rangeArgs );
        const options = {
        dimensions: 'date',
        startDate,
        endDate,
        };
        if ( url ) {
        options.url = url;
        }

Test Coverage

  • Update assets/js/components/KeyMetrics/KeyMetricsSetupCTAWidget.test.js to use getSampleReportArgs imported from assets/js/modules/analytics-4/datastore/report.js.
  • No additional test coverage required.

QA Brief

Changelog entry

@techanvil techanvil added P2 Low priority Type: Infrastructure Engineering infrastructure & tooling labels Jan 23, 2025
@benbowler benbowler self-assigned this Jan 27, 2025
@benbowler benbowler added the QA: Eng Requires specialized QA by an engineer label Jan 28, 2025
@benbowler benbowler removed their assignment Jan 28, 2025
@techanvil techanvil self-assigned this Jan 30, 2025
@techanvil
Copy link
Collaborator Author

IB ✅

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
P2 Low priority QA: Eng Requires specialized QA by an engineer Type: Infrastructure Engineering infrastructure & tooling
Projects
None yet
Development

No branches or pull requests

2 participants