Skip to content

Commit

Permalink
Clean up
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Oct 17, 2024
1 parent a224bab commit 2df5403
Show file tree
Hide file tree
Showing 6 changed files with 0 additions and 26 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ const reducer = combineReducers( {
socialImageGeneratorSettings,
shareStatus,
hasPaidPlan: ( state = false ) => state,
userConnectionUrl: ( state = '' ) => state,
hasPaidFeatures: ( state = false ) => state,
} );

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -54,15 +54,6 @@ export function getConnectionsByService( state, serviceName ) {
return getConnections( state ).filter( ( { service_name } ) => service_name === serviceName );
}

/**
* Returns the connections admin URL from the store.
* @param {import("../types").SocialStoreState} state - State object.
* @return {string|null} The connections admin URL.
*/
export function getConnectionsAdminUrl( state ) {
return state.connectionData?.adminUrl ?? null;
}

/**
* Returns whether there are connections in the store.
* @param {import("../types").SocialStoreState} state - State object.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,6 @@ const selectors = {
...jetpackSettingSelectors,
...socialImageGeneratorSettingsSelectors,
...shareStatusSelectors,
userConnectionUrl: state => state.userConnectionUrl,
hasPaidFeatures: state => state.hasPaidFeatures,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
const siteDataSelectors = {
getAdminUrl: state => state.siteData?.adminUrl ?? null,
getAPIRootUrl: state => state.siteData?.apiRoot ?? null,
getAPINonce: state => state.siteData?.apiNonce ?? null,
getRegistrationNonce: state => state.siteData?.registrationNonce ?? null,
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
import {
getConnections,
getConnectionsAdminUrl,
hasConnections,
getFailedConnections,
getMustReauthConnections,
Expand All @@ -11,7 +10,6 @@ import {

const state = {
connectionData: {
adminUrl: 'https://wordpress.com/some-url',
connections: [
{
id: '123456789',
Expand Down Expand Up @@ -64,17 +62,6 @@ describe( 'Social store selectors: connectionData', () => {
} );
} );

describe( 'getConnectionsAdminUrl', () => {
it( 'should return null if no adminUrl', () => {
expect( getConnectionsAdminUrl( {} ) ).toBeNull();
} );

it( 'should return adminUrl', () => {
const adminUrl = getConnectionsAdminUrl( state );
expect( adminUrl ).toEqual( state.connectionData.adminUrl );
} );
} );

describe( 'hasConnections', () => {
it( 'should return false if no connections', () => {
expect( hasConnections( {} ) ).toBe( false );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,6 @@ type JetpackSettingsSelectors = {

type ConnectionDataSelectors = {
getConnections: () => Array< object >;
getConnectionsAdminUrl: () => string;
hasConnections: () => boolean;
};

Expand Down

0 comments on commit 2df5403

Please sign in to comment.