fix: application support link with mailto: URI schema (#18416)

This commit is contained in:
Sachin Chaurasiya 2024-10-28 10:58:23 +05:30 committed by GitHub
parent c1a3206538
commit 09e6671f2f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 1 deletions

View File

@ -203,7 +203,10 @@ const MarketPlaceAppDetails = () => {
<Space className="p-t-lg" direction="vertical" size={8}>
<Typography.Text>
{appData?.supportEmail && (
<Typography.Link href={appData?.supportEmail} target="_blank">
<Typography.Link
data-testid="app-support-email"
href={`mailto:${appData?.supportEmail}`}
target="_blank">
<Space>{t('label.get-app-support')}</Space>
</Typography.Link>
)}

View File

@ -179,4 +179,15 @@ describe('MarketPlaceAppDetails component', () => {
expect(mockPush).toHaveBeenCalledWith('app install path');
});
it("should render the correct support email url with 'mailto:' schema", async () => {
render(<MarketPlaceAppDetails />);
await waitForElementToBeRemoved(() => screen.getByText('Loader'));
expect(screen.getByTestId('app-support-email')).toHaveAttribute(
'href',
'mailto:support@email.com'
);
});
});