From 0b628dab322c15c5e7c3db41d7b5aedcabaacae0 Mon Sep 17 00:00:00 2001 From: Manzoor Wani Date: Fri, 13 Dec 2024 16:27:42 +0530 Subject: [PATCH] Fix unit tests --- .../selectors/test/connection-data.test.js | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) diff --git a/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js b/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js index b73f4d62f1c49..7cfce26a5feaf 100644 --- a/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js +++ b/projects/js-packages/publicize-components/src/social-store/selectors/test/connection-data.test.js @@ -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: '@somename@mastodon.social', + external_handle: '@somename@mastodon.social', enabled: false, connection_id: '219876543', - test_success: 'must_reauth', + status: 'ok', }, ], }, @@ -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, ] ); } ); } ); @@ -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, } ); } );