Skip to content

Commit e95c627

Browse files
committed
Update tests
1 parent 9c5a94a commit e95c627

File tree

5 files changed

+10
-12
lines changed

5 files changed

+10
-12
lines changed

common/lib/tests/oauth.test.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,15 +5,15 @@ describe( 'getAuthenticationUrl', () => {
55
const result = getAuthenticationUrl( 'en' );
66

77
expect( result ).toBe(
8-
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wpcom-local-dev%3A%2F%2Fauth&scope=global&locale=en'
8+
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wp-studio%3A%2F%2Fauth&scope=global&locale=en'
99
);
1010
} );
1111

1212
it( 'should generate correct authentication URL with other locales', () => {
1313
const result = getAuthenticationUrl( 'es' );
1414

1515
expect( result ).toBe(
16-
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wpcom-local-dev%3A%2F%2Fauth&scope=global&locale=es'
16+
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wp-studio%3A%2F%2Fauth&scope=global&locale=es'
1717
);
1818
} );
1919
} );

src/lib/deeplink/tests/auth.test.ts

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ describe( 'handleAuthDeeplink', () => {
3333
req: { get: mockWpcomGet },
3434
} as unknown as WPCOM );
3535

36-
const url = new URL( 'wpcom-local-dev://auth#access_token=mock-token&expires_in=3600' );
36+
const url = new URL( 'wp-studio://auth#access_token=mock-token&expires_in=3600' );
3737
await handleAuthDeeplink( url );
3838

3939
expect( sendIpcEventToRenderer ).toHaveBeenCalledWith( 'auth-updated', {
@@ -49,7 +49,7 @@ describe( 'handleAuthDeeplink', () => {
4949
} );
5050

5151
it( 'should handle authentication error from WordPress.com', async () => {
52-
const url = new URL( 'wpcom-local-dev://auth#error=access_denied' );
52+
const url = new URL( 'wp-studio://auth#error=access_denied' );
5353
await handleAuthDeeplink( url );
5454

5555
expect( sendIpcEventToRenderer ).toHaveBeenCalledWith( 'auth-updated', {
@@ -59,7 +59,7 @@ describe( 'handleAuthDeeplink', () => {
5959
} );
6060

6161
it( 'should handle invalid token response', async () => {
62-
const url = new URL( 'wpcom-local-dev://auth#access_token=mock-token&expires_in=invalid' );
62+
const url = new URL( 'wp-studio://auth#access_token=mock-token&expires_in=invalid' );
6363
await handleAuthDeeplink( url );
6464

6565
expect( sendIpcEventToRenderer ).toHaveBeenCalledWith( 'auth-updated', {
@@ -74,7 +74,7 @@ describe( 'handleAuthDeeplink', () => {
7474
req: { get: mockWpcomGet },
7575
} as unknown as WPCOM );
7676

77-
const url = new URL( 'wpcom-local-dev://auth#access_token=mock-token&expires_in=3600' );
77+
const url = new URL( 'wp-studio://auth#access_token=mock-token&expires_in=3600' );
7878
await handleAuthDeeplink( url );
7979

8080
expect( sendIpcEventToRenderer ).toHaveBeenCalledWith( 'auth-updated', {

src/lib/deeplink/tests/sync-connect-site.test.ts

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,7 @@ describe( 'handleSyncConnectSiteDeeplink', () => {
1212
} );
1313

1414
it( 'should handle sync connect site callback', async () => {
15-
const url = new URL(
16-
'wpcom-local-dev://sync-connect-site?remoteSiteId=123&studioSiteId=local-site'
17-
);
15+
const url = new URL( 'wp-studio://sync-connect-site?remoteSiteId=123&studioSiteId=local-site' );
1816
await handleSyncConnectSiteDeeplink( url );
1917

2018
expect( sendIpcEventToRenderer ).toHaveBeenCalledWith( 'sync-connect-site', {
@@ -24,7 +22,7 @@ describe( 'handleSyncConnectSiteDeeplink', () => {
2422
} );
2523

2624
it( 'should not send sync connect site event if parameters are missing', async () => {
27-
const url = new URL( 'wpcom-local-dev://sync-connect-site?remoteSiteId=123' );
25+
const url = new URL( 'wp-studio://sync-connect-site?remoteSiteId=123' );
2826
await handleSyncConnectSiteDeeplink( url );
2927

3028
expect( sendIpcEventToRenderer ).not.toHaveBeenCalled();

src/lib/tests/oauth.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -90,7 +90,7 @@ describe( 'getSignUpUrl', () => {
9090
it( 'should include encoded authentication URL as oauth2_redirect parameter', () => {
9191
const locale: SupportedLocale = 'es';
9292
const mockAuthUrl =
93-
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wpcom-local-dev%3A%2F%2Fauth&scope=global&locale=es';
93+
'https://public-api.wordpress.com/oauth2/authorize?response_type=token&client_id=95109&redirect_uri=wp-studio%3A%2F%2Fauth&scope=global&locale=es';
9494
const result = getSignUpUrl( locale );
9595

9696
const url = new URL( result );

src/tests/index.test.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -100,7 +100,7 @@ describe( 'App initialization', () => {
100100
require( '../index' );
101101
const { 'open-url': openUrl } = mockedEvents;
102102

103-
const testUrl = 'wpcom-local-dev://auth#test-hash';
103+
const testUrl = 'wp-studio://auth#test-hash';
104104
await openUrl( {}, testUrl );
105105
expect( mockHandleDeeplink ).toHaveBeenCalledWith( testUrl );
106106

0 commit comments

Comments
 (0)