Skip to content

Commit

Permalink
added validation for null base64 conversion during logo upload
Browse files Browse the repository at this point in the history
  • Loading branch information
pranavnathe committed Jan 12, 2025
1 parent a7463ae commit 9107a86
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/screens/CommunityProfile/CommunityProfile.spec.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -577,9 +577,15 @@ describe('Testing Community Profile Screen', () => {
default: vi.fn().mockResolvedValue(null),
}));

const fileInput = screen.getByTestId('fileInput');
const fileInput = screen.getByTestId('fileInput') as HTMLInputElement;
userEvent.upload(fileInput, mockFile);
await wait();

// Ensure state or UI behavior when base64 conversion fails
expect(fileInput.value).toBe('');

// Ensure no success toast is shown for null conversion
expect(toast.success).not.toHaveBeenCalled();
});

test('should show success toast when profile is updated successfully', async () => {
Expand Down

0 comments on commit 9107a86

Please sign in to comment.