Skip to content
Open
Show file tree
Hide file tree
Changes from 16 commits
Commits
Show all changes
38 commits
Select commit Hold shift + click to select a range
f7d1f8a
Update packages with React 17 and tests passing.
tofumatt Mar 15, 2026
1cf9a8d
Update Stylelint version.
tofumatt Mar 17, 2026
a343a91
Merge branch 'develop' into typescript-fewer-package-changes.
tofumatt Mar 18, 2026
4be3e51
Fix Stylelint issues and package resolutions.
tofumatt Mar 21, 2026
e7b1dd8
Merge branch 'develop' into typescript-fewer-package-changes.
tofumatt Mar 21, 2026
c92c709
Fix tests.
tofumatt Mar 22, 2026
1509b8e
Merge branch 'develop' into typescript-fewer-package-changes.
tofumatt Mar 24, 2026
ae6dae6
Update snapshots to include retry buttons.
tofumatt Mar 24, 2026
2421344
Update settings module snapshot with example URL.
tofumatt Mar 24, 2026
00a421e
Mock Analytics settings endpoint for tests that rely on it.
tofumatt Mar 25, 2026
9c2d6fd
Wait for registry to complete work in test.
tofumatt Mar 25, 2026
34c6558
Re-render tooltip test.
tofumatt Mar 25, 2026
8c886a5
Ensure console errors are consistently fired/caught in tests.
tofumatt Apr 1, 2026
caf5590
Fix tests and related fixes.
aaemnnosttv Apr 1, 2026
0d17205
Revert added storeName in modules list fixture.
aaemnnosttv Apr 1, 2026
2b67f55
Add missing calls to provideModuleRegistrations.
aaemnnosttv Apr 1, 2026
8aaa7e6
Fix typecheck errors.
aaemnnosttv Apr 1, 2026
1c01fd2
Fix remaining tests.
aaemnnosttv Apr 1, 2026
96b27b2
Fix lint warnings.
aaemnnosttv Apr 1, 2026
b089add
Fix typo in body parameter name.
aaemnnosttv Apr 1, 2026
31ec565
Remove extra quote in assertion.
aaemnnosttv Apr 1, 2026
b26a87a
Merge branch 'develop' into typescript-fewer-package-changes.
aaemnnosttv Apr 1, 2026
06d92af
Update deprecated action.
aaemnnosttv Apr 1, 2026
7a46c67
Upgrade react-test-renderer to match new react version.
aaemnnosttv Apr 1, 2026
27059b8
Merge branch 'develop' into typescript-fewer-package-changes.
tofumatt Apr 2, 2026
0cc7951
Prevent hash changes from breaking VRTs.
tofumatt Apr 2, 2026
9af15ce
Trigger enhanced measurement settings fetch in Analytics component.
tofumatt Apr 3, 2026
2291758
Fix `isLoading` check in Analytics.
tofumatt Apr 3, 2026
68699ae
Update dependencies in selectors to trigger component refreshes.
tofumatt Apr 7, 2026
d7faf01
Merge branch 'develop' into typescript-fewer-package-changes.
tofumatt Apr 7, 2026
7fd2bec
Fix package lock file.
tofumatt Apr 7, 2026
6c196a5
Fix test failures and fetch logic.
tofumatt Apr 8, 2026
2352a32
Add node types.
tofumatt Apr 8, 2026
bec51f9
Install playwright after install.
tofumatt Apr 8, 2026
c464238
Ensure setup form refreshes when settings change.
tofumatt Apr 8, 2026
fea6b33
Add patch to @wordpress/data.
tofumatt Apr 8, 2026
50948f8
Fix wordpress/data patch.
aaemnnosttv Apr 8, 2026
36cb23b
Merge branch 'develop' into typescript-fewer-package-changes.
aaemnnosttv Apr 10, 2026
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
67 changes: 34 additions & 33 deletions .stylelintrc
Original file line number Diff line number Diff line change
@@ -1,34 +1,35 @@
{
"extends": [
"@wordpress/stylelint-config",
"stylelint-config-standard-scss"
],
"plugins": [
"stylelint-declaration-strict-value",
"stylelint-order",
"stylelint-scss"
],
"rules": {
"indentation": "tab",
"declaration-empty-line-before": null,
"scss/no-global-function-names": null,
"scss/dollar-variable-empty-line-before": null,
"scss/at-extend-no-missing-placeholder": null,
"scss/dollar-variable-pattern": null,
"color-function-notation": null,
"alpha-value-notation": null,
"rule-empty-line-before": null,
"at-rule-empty-line-before": null,
"string-quotes": "double",
"at-rule-no-unknown": null,
"declaration-property-unit-allowed-list": null,
"function-url-quotes": "always",
"selector-class-pattern": null,
"order/properties-alphabetical-order": true,
"value-keyword-case": [ "lower", {
"ignoreKeywords": ["/([A-Z])/"]
}
],
"selector-nested-pattern": "^(?!&__|&--|&-|&_).*"
}
}
"extends": [
"@wordpress/stylelint-config",
"stylelint-config-standard-scss"
],
"plugins": [
"stylelint-declaration-strict-value",
"stylelint-order",
"stylelint-scss"
],
"rules": {
"shorthand-property-no-redundant-values": null,
"declaration-empty-line-before": null,
"scss/no-global-function-names": null,
"scss/dollar-variable-empty-line-before": null,
"scss/at-extend-no-missing-placeholder": null,
"scss/dollar-variable-pattern": null,
"color-function-notation": null,
"alpha-value-notation": null,
"rule-empty-line-before": null,
"at-rule-empty-line-before": null,
"at-rule-no-unknown": null,
"declaration-property-unit-allowed-list": null,
"function-url-quotes": "always",
"selector-class-pattern": null,
"order/properties-alphabetical-order": true,
"value-keyword-case": [
"lower",
{
"ignoreKeywords": [ "/([A-Z])/" ]
}
],
"selector-nested-pattern": "^(?!&__|&--|&-|&_).*"
}
}
1 change: 0 additions & 1 deletion assets/js/components/ModalDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,6 @@ function ModalDialog( {
<Button
className="mdc-dialog__cancel-button"
onClick={ handleCancel }
disabled={ inProgress }
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

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

This was causing an error from focus trap because all focusable elements can't be disabled in the trap.

tertiary
>
{ __( 'Cancel', 'google-site-kit' ) }
Expand Down
17 changes: 14 additions & 3 deletions assets/js/components/TourTooltips.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import {
render,
createTestRegistry,
fireEvent,
act,
} from '../../../tests/js/test-utils';
import TourTooltips, { GA_ACTIONS } from './TourTooltips';
import { CORE_UI } from '@/js/googlesitekit/datastore/ui/constants';
Expand Down Expand Up @@ -227,11 +228,21 @@ describe( 'TourTooltips', () => {
);
} );

it( 'should end tour when close icon is clicked', () => {
const { getByRole, queryByRole } =
it( 'should end tour when close icon is clicked', async () => {
const { getByRole, queryByRole, rerender } =
renderTourTooltipsWithMockUI( registry );

fireEvent.click( getByRole( 'button', { name: /close/i } ) );
await act( () => {
fireEvent.click( getByRole( 'button', { name: /close/i } ) );
} );

rerender();

// This error is caused by the `react-select` component trying to update
// state after the component has unmounted, so we can't fix it ourselves.
expect( console ).toHaveErrored(
'Warning: Can\'t perform a React state update on an unmounted component. This is a no-op, but it indicates a memory leak in your application. To fix, cancel all subscriptions and asynchronous tasks in %s.%s"'
);

expect( queryByRole( 'alertdialog' ) ).not.toBeInTheDocument();
expect( dismissTourSpy ).toHaveBeenCalled();
Expand Down
13 changes: 10 additions & 3 deletions assets/js/components/dashboard-sharing/UserRoleSelect.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,9 @@ import {
render,
fireEvent,
createTestRegistry,
act,
} from '../../../../tests/js/test-utils';
import { waitForTimeouts } from '../../../../tests/js/utils';
import UserRoleSelect from './UserRoleSelect';
import { MODULE_SLUG_SEARCH_CONSOLE } from '@/js/modules/search-console/constants';

Expand Down Expand Up @@ -224,9 +226,14 @@ describe( 'CurrentSurvey', () => {

await waitForRegistry();

fireEvent.click(
container.querySelector( '.googlesitekit-user-role-select__button' )
);
await act( async () => {
fireEvent.click(
container.querySelector(
'.googlesitekit-user-role-select__button'
)
);
await waitForTimeouts( 100 );
} );

expect(
container.querySelector(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,8 @@ import {
provideModules,
} from '../../../../../tests/js/test-utils';
import { CORE_SITE } from '@/js/googlesitekit/datastore/site/constants';
import { MODULES_ANALYTICS_4 } from '@/js/modules/analytics-4/datastore/constants';
import { defaultSettings as analytics4DefaultSettings } from '@/js/modules/analytics-4/datastore/__fixtures__';
import * as tracking from '@/js/util/tracking';
import { VIEW_CONTEXT_MAIN_DASHBOARD_VIEW_ONLY } from '@/js/googlesitekit/constants';

Expand Down Expand Up @@ -76,6 +78,9 @@ describe( 'EmailReportingErrorNotices', () => {

it( 'should render the permissions error notice when email reporting is enabled, user is not view-only, and there is a permissions_error category ID and a module slug', () => {
provideModules( registry );
registry
.dispatch( MODULES_ANALYTICS_4 )
.receiveGetSettings( analytics4DefaultSettings );
registry.dispatch( CORE_SITE ).receiveGetEmailReportingSettings( {
enabled: true,
} );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import fetchMock from 'fetch-mock';
*/
import GoogleTagGatewaySetupBanner from './GoogleTagGatewaySetupBanner';
import {
act,
createTestRegistry,
fireEvent,
provideModules,
Expand Down Expand Up @@ -311,11 +312,13 @@ describe( 'GoogleTagGatewaySetupBanner', () => {
NOTIFICATION_GROUPS.DEFAULT,
] );

fireEvent.click(
getByRole( 'button', {
name: 'Enable Google tag gateway for advertisers',
} )
);
await act( () => {
fireEvent.click(
getByRole( 'button', {
name: 'Enable Google tag gateway for advertisers',
} )
);
} );

await waitForRegistry();

Expand All @@ -329,6 +332,8 @@ describe( 'GoogleTagGatewaySetupBanner', () => {
expect( fetchMock ).toHaveFetched( dismissItemEndpoint );
} );

await waitForRegistry();

expect(
registry
.select( CORE_NOTIFICATIONS )
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,7 @@ import {
render,
createTestRegistry,
provideModules,
provideUserAuthentication,
} from '../../../../../tests/js/test-utils';
import { MODULE_SLUG_ADS } from '@/js/modules/ads/constants';
import { CORE_UI } from '@/js/googlesitekit/datastore/ui/constants';
Expand All @@ -36,6 +37,7 @@ describe( 'ConfirmDisconnect', () => {

beforeEach( () => {
registry = createTestRegistry();
provideUserAuthentication( registry );
registry
.dispatch( CORE_UI )
.setValue( 'module-ads-dialogActive', true );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ exports[`ConfirmDisconnect should render the Ads Disconnect ModalDialog with a d
<a
aria-label="Ads (opens in a new tab)"
class="googlesitekit-cta-link"
href="https://accounts.google.com/accountchooser?continue=https%3A%2F%2Fgoogle.com%2Fads%3Futm_source%3Dsitekit&Email=test%40example.com&utm_source=sitekit"
href="https://accounts.google.com/accountchooser?continue=https%3A%2F%2Fexample.com%2Faccount%2Foverview%2Furl%3Futm_source%3Dsitekit&Email=test%40example.com&utm_source=sitekit"
rel="noopener noreferrer"
target="_blank"
>
Expand Down
5 changes: 4 additions & 1 deletion assets/js/googlesitekit/modules/datastore/modules.js
Original file line number Diff line number Diff line change
Expand Up @@ -1384,7 +1384,10 @@ const baseSelectors = {
// A store with this name doesn't exist, so the user can't have access to it.
// This is either caused by a module not being loaded or an incorrect module
// name being used.
if ( select( moduleStoreName ) === null ) {
if (
select( moduleStoreName ) === null ||
select( moduleStoreName ) === undefined
) {
return null;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ import { render } from '../../../../../../tests/js/test-utils';
import {
createTestRegistry,
provideKeyMetrics,
provideModuleRegistrations,
provideModules,
freezeFetch,
} from '../../../../../../tests/js/utils';
Expand Down Expand Up @@ -163,6 +164,8 @@ describe( 'TopEarningContentWidget', () => {
} );

it( 'should render the generic error variant when the report fetch fails', async () => {
provideModuleRegistrations( registry );

const errorResponse = {
code: ERROR_INTERNAL_SERVER_ERROR,
message: 'Internal server error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -169,9 +169,20 @@ exports[`TopEarningContentWidget should render the generic error variant when th
<div
class="googlesitekit-report-error-actions"
>
<div
<button
class="mdc-button mdc-button--raised"
target="_self"
>
<span
class="mdc-button__label"
>
Retry
</span>
</button>
<span
class="googlesitekit-error-retry-text"
>
Retry didn’t work?
<a
aria-label="Get help (opens in a new tab)"
class="googlesitekit-cta-link"
Expand All @@ -185,7 +196,7 @@ exports[`TopEarningContentWidget should render the generic error variant when th
Get help
</span>
</a>
</div>
</span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,20 @@ exports[`DashboardAllTrafficWidgetGA4 should render an error state if there is a
<div
class="googlesitekit-report-error-actions"
>
<div>
<button
class="mdc-button mdc-button--raised"
target="_self"
>
<span
class="mdc-button__label"
>
Retry
</span>
</button>
<span
class="googlesitekit-error-retry-text"
>
Retry didn’t work?
<a
aria-label="Get help (opens in a new tab)"
class="googlesitekit-cta-link"
Expand All @@ -46,7 +59,7 @@ exports[`DashboardAllTrafficWidgetGA4 should render an error state if there is a
Get help
</span>
</a>
</div>
</span>
</div>
</div>
</div>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@ import {
import { MODULE_SLUG_ANALYTICS_4 } from '@/js/modules/analytics-4/constants';
import {
createTestRegistry,
provideModuleRegistrations,
provideModules,
provideSiteInfo,
provideUserAuthentication,
Expand Down Expand Up @@ -214,6 +215,8 @@ describe( 'DashboardAllTrafficWidgetGA4', () => {
} );

it( 'should render an error state if there is a report error', async () => {
provideModuleRegistrations( registry );

const error = {
code: 'missing_required_param',
message: 'Request parameter is empty: metrics.',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
createTestRegistry,
freezeFetch,
provideKeyMetrics,
provideModuleRegistrations,
provideModules,
} from '../../../../../../tests/js/utils';
import { provideAnalytics4MockReport } from '@/js/modules/analytics-4/utils/data-mock';
Expand All @@ -40,12 +41,17 @@ import {
ERROR_REASON_INSUFFICIENT_PERMISSIONS,
} from '@/js/util/errors';
import EngagedTrafficSourceWidget from './EngagedTrafficSourceWidget';
import * as analyticsFixtures from '@/js/modules/analytics-4/datastore/__fixtures__';

describe( 'EngagedTrafficSourceWidget', () => {
let registry;
const { Widget, WidgetNull } = getWidgetComponentProps(
KM_ANALYTICS_ENGAGED_TRAFFIC_SOURCE
);

const analytics4SettingsEndpoint = new RegExp(
'^/google-site-kit/v1/modules/analytics-4/data/settings'
);
const reportEndpoint = new RegExp(
'^/google-site-kit/v1/modules/analytics-4/data/report'
);
Expand All @@ -55,6 +61,10 @@ describe( 'EngagedTrafficSourceWidget', () => {
registry.dispatch( CORE_USER ).setReferenceDate( '2020-09-08' );
provideKeyMetrics( registry );
provideModules( registry, withConnected( MODULE_SLUG_ANALYTICS_4 ) );

fetchMock.getOnce( analytics4SettingsEndpoint, {
body: analyticsFixtures.defaultSettings,
} );
} );

it( 'should render correctly with the expected metrics', async () => {
Expand Down Expand Up @@ -108,6 +118,8 @@ describe( 'EngagedTrafficSourceWidget', () => {
} );

it( 'should render the generic error variant when the report fetch fails', async () => {
provideModuleRegistrations( registry );

const errorResponse = {
code: ERROR_INTERNAL_SERVER_ERROR,
message: 'Internal server error',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,7 @@ import {
createTestRegistry,
freezeFetch,
provideKeyMetrics,
provideModuleRegistrations,
provideModules,
} from '../../../../../../tests/js/utils';
import {
Expand Down Expand Up @@ -198,6 +199,8 @@ describe( 'LeastEngagingPagesWidget', () => {
} );

it( 'should render the generic error variant when the report fetch fails', async () => {
provideModuleRegistrations( registry );

const errorResponse = {
code: ERROR_INTERNAL_SERVER_ERROR,
message: 'Internal server error',
Expand Down
Loading
Loading