Refactor: Update FlyerUploader tests to improve job status mocking and enhance clarity in polling logic
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 12m44s
All checks were successful
Deploy to Test Environment / deploy-to-test (push) Successful in 12m44s
This commit is contained in:
@@ -143,11 +143,17 @@ export const ProfileManager: React.FC<ProfileManagerProps> = ({ isOpen, onClose,
|
||||
// Error is already handled by useApi hook, but we log it for good measure.
|
||||
logger.error({ err: result.reason }, 'A profile save operation failed:');
|
||||
} else if (result.status === 'fulfilled') {
|
||||
// If this was the profile update promise, capture its result.
|
||||
// We assume the profile promise is always first if it exists.
|
||||
if (profileDataChanged && index === 0 && result.value) {
|
||||
updatedProfileData = result.value as Profile;
|
||||
onProfileUpdate(updatedProfileData);
|
||||
// useApi returns null if an error occurred but was caught.
|
||||
// We must treat null results as failures for the purpose of 'allSucceeded'.
|
||||
if (!result.value) {
|
||||
allSucceeded = false;
|
||||
} else {
|
||||
// If this was the profile update promise, capture its result.
|
||||
// We assume the profile promise is always first if it exists.
|
||||
if (profileDataChanged && index === 0) {
|
||||
updatedProfileData = result.value as Profile;
|
||||
onProfileUpdate(updatedProfileData);
|
||||
}
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user