@automattic/jetpack-connection 1.2.2 → 1.2.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -2,6 +2,14 @@
2
2
 
3
3
  ### This is a list detailing changes for the Jetpack RNA Connection Component releases.
4
4
 
5
+ ## [1.2.4] - 2025-06-19
6
+ ### Changed
7
+ - Update dependencies.
8
+
9
+ ## [1.2.3] - 2025-06-18
10
+ ### Changed
11
+ - Internal updates.
12
+
5
13
  ## [1.2.2] - 2025-06-16
6
14
  ### Changed
7
15
  - Update dependencies.
@@ -1060,6 +1068,8 @@
1060
1068
  - `Main` and `ConnectUser` components added.
1061
1069
  - `JetpackRestApiClient` API client added.
1062
1070
 
1071
+ [1.2.4]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.3...v1.2.4
1072
+ [1.2.3]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.2...v1.2.3
1063
1073
  [1.2.2]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.1...v1.2.2
1064
1074
  [1.2.1]: https://github.com/Automattic/jetpack-connection-js/compare/v1.2.0...v1.2.1
1065
1075
  [1.2.0]: https://github.com/Automattic/jetpack-connection-js/compare/v1.1.0...v1.2.0
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@automattic/jetpack-connection",
3
- "version": "1.2.2",
3
+ "version": "1.2.4",
4
4
  "description": "Jetpack Connection Component",
5
5
  "homepage": "https://github.com/Automattic/jetpack/tree/HEAD/projects/js-packages/connection/#readme",
6
6
  "bugs": {
@@ -14,10 +14,10 @@
14
14
  "author": "Automattic",
15
15
  "license": "GPL-2.0-or-later",
16
16
  "dependencies": {
17
- "@automattic/jetpack-analytics": "^1.0.0",
18
- "@automattic/jetpack-api": "^1.0.0",
19
- "@automattic/jetpack-components": "^1.1.2",
20
- "@automattic/jetpack-config": "^1.0.0",
17
+ "@automattic/jetpack-analytics": "^1.0.1",
18
+ "@automattic/jetpack-api": "^1.0.1",
19
+ "@automattic/jetpack-components": "^1.1.4",
20
+ "@automattic/jetpack-config": "^1.0.1",
21
21
  "@automattic/jetpack-script-data": "^0.4.3",
22
22
  "@wordpress/base-styles": "6.0.0",
23
23
  "@wordpress/browserslist-config": "6.24.0",
@@ -39,8 +39,8 @@
39
39
  "@testing-library/react": "16.2.0",
40
40
  "@testing-library/user-event": "14.6.1",
41
41
  "@types/react": "18.3.23",
42
- "jest": "29.7.0",
43
- "jest-environment-jsdom": "29.7.0",
42
+ "jest": "30.0.0",
43
+ "jest-environment-jsdom": "30.0.0",
44
44
  "react": "18.3.1",
45
45
  "react-dom": "18.3.1",
46
46
  "storybook": "8.6.7"
@@ -0,0 +1,13 @@
1
+ /* istanbul ignore file */ // This is intended to be mocked in tests, because we can't mock window.location.
2
+
3
+ /**
4
+ * Wrapper for window.location.assign
5
+ *
6
+ * So we can mock it in tests.
7
+ *
8
+ * @param {string} url - URL to assign.
9
+ * @return {undefined}
10
+ */
11
+ export function assignLocation( url ) {
12
+ return window.location.assign( url );
13
+ }
@@ -1,5 +1,6 @@
1
1
  import restApi from '@automattic/jetpack-api';
2
2
  import { createRegistryControl } from '@wordpress/data';
3
+ import { assignLocation } from './assignLocation';
3
4
  import STORE_ID from './store-id';
4
5
 
5
6
  const REGISTER_SITE = ( { redirectUri, from } ) => restApi.registerSite( null, redirectUri, from );
@@ -11,7 +12,7 @@ const CONNECT_USER = createRegistryControl(
11
12
  resolveSelect( STORE_ID )
12
13
  .getAuthorizationUrl( redirectUri )
13
14
  .then( authorizationUrl => {
14
- const redirect = redirectFunc || ( url => window.location.assign( url ) );
15
+ const redirect = redirectFunc || ( url => assignLocation( url ) );
15
16
 
16
17
  const url = new URL( authorizationUrl );
17
18