Skip to content

Commit

Permalink
Fix unit tests
Browse files Browse the repository at this point in the history
  • Loading branch information
manzoorwanijk committed Dec 13, 2024
1 parent 13e91e7 commit 0b628da
Showing 1 changed file with 8 additions and 11 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,34 +12,31 @@ const state = {
connectionData: {
connections: [
{
id: '123456789',
service_name: 'facebook',
display_name: 'Some name',
profile_picture: 'https://wordpress.com/some-url-of-a-picture',
username: 'username',
external_handle: 'external_handle',
enabled: false,
connection_id: '987654321',
test_success: true,
status: 'ok',
},
{
id: '234567891',
service_name: 'tumblr',
display_name: 'Some name',
profile_picture: 'https://wordpress.com/some-url-of-another-picture',
username: 'username',
external_handle: 'external_handle',
enabled: true,
connection_id: '198765432',
test_success: false,
status: 'broken',
},
{
id: '345678912',
service_name: 'mastodon',
display_name: 'somename',
profile_picture: 'https://wordpress.com/some-url-of-one-more-picture',
username: '@[email protected]',
external_handle: '@[email protected]',
enabled: false,
connection_id: '219876543',
test_success: 'must_reauth',
status: 'ok',
},
],
},
Expand Down Expand Up @@ -93,7 +90,7 @@ describe( 'Social store selectors: connectionData', () => {
it( 'should return must reauth connections', () => {
const mustReauthConnections = getMustReauthConnections( state );
expect( mustReauthConnections ).toEqual( [
state.connectionData.connections[ 2 ].service_name,
state.connectionData.connections[ 1 ].service_name,
] );
} );
} );
Expand Down Expand Up @@ -140,7 +137,7 @@ describe( 'Social store selectors: connectionData', () => {
expect( getConnectionProfileDetails( state, 'facebook' ) ).toEqual( {
displayName: connection.display_name,
profileImage: connection.profile_picture,
username: connection.username,
username: connection.external_handle,
} );
} );

Expand Down

0 comments on commit 0b628da

Please sign in to comment.