Skip to content

Commit

Permalink
avoid exporting updateSettingsValues
Browse files Browse the repository at this point in the history
  • Loading branch information
Timur Karimov committed Mar 26, 2024
1 parent 38d9091 commit c18a509
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 10 deletions.
2 changes: 1 addition & 1 deletion client/data/settings/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { __ } from '@wordpress/i18n';
import ACTION_TYPES from './action-types';
import { NAMESPACE, STORE_NAME } from '../constants';

export function updateSettingsValues( payload ) {
function updateSettingsValues( payload ) {
return {
type: ACTION_TYPES.SET_SETTINGS_VALUES,
payload,
Expand Down
15 changes: 6 additions & 9 deletions client/data/settings/test/actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,7 @@ import { apiFetch } from '@wordpress/data-controls';
/**
* Internal dependencies
*/
import {
saveSettings,
updateIsSavingSettings,
updateSettingsValues,
} from '../actions';
import { saveSettings, updateIsSavingSettings } from '../actions';

jest.mock( '@wordpress/data' );
jest.mock( '@wordpress/data-controls' );
Expand Down Expand Up @@ -84,12 +80,13 @@ describe( 'Settings actions tests', () => {
// Simulate the response from the apiFetch call and proceed to the next yield
// Since the actual fetching process is mocked, pass the apiResponse to the next saveGenerator step directly
next = saveGenerator.next( apiResponse );
expect( next.value ).toEqual(
updateSettingsValues( {
expect( next.value ).toEqual( {
type: 'SET_SETTINGS_VALUES',
payload: {
payment_method_statuses:
apiResponse.data.payment_method_statuses,
} )
);
},
} );

next = saveGenerator.next(); // Skip the success notice
next = saveGenerator.next(); // Move to updateIsSavingSettings(false)
Expand Down

0 comments on commit c18a509

Please sign in to comment.