Show preview alert only for preview apps (#15926)

* show alert for only preview apps

* update tests
This commit is contained in:
Karan Hotchandani 2024-04-17 13:59:21 +05:30 committed by GitHub
parent 67f01625b0
commit 92962c43ae
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 30 additions and 26 deletions

View File

@ -143,7 +143,6 @@ const MarketPlaceAppDetails = () => {
{t('label.browse-app-plural')} {t('label.browse-app-plural')}
</Typography.Text> </Typography.Text>
</Button> </Button>
<div className="flex-center m-t-md"> <div className="flex-center m-t-md">
<AppLogo appName={appData?.fullyQualifiedName ?? ''} /> <AppLogo appName={appData?.fullyQualifiedName ?? ''} />
</div> </div>
@ -159,6 +158,7 @@ const MarketPlaceAppDetails = () => {
</Button> </Button>
</Tooltip> </Tooltip>
{isPreviewApp && (
<Alert <Alert
className="m-t-md text-xs d-flex items-start p-xs" className="m-t-md text-xs d-flex items-start p-xs"
message={ message={
@ -182,14 +182,13 @@ const MarketPlaceAppDetails = () => {
} }
type="info" type="info"
/> />
)}
<div className="m-t-md"> <div className="m-t-md">
<CheckMarkIcon className="v-middle m-r-xss" /> <CheckMarkIcon className="v-middle m-r-xss" />
<Typography.Text className="text-xs font-medium text-grey-muted"> <Typography.Text className="text-xs font-medium text-grey-muted">
{t('message.marketplace-verify-msg')} {t('message.marketplace-verify-msg')}
</Typography.Text> </Typography.Text>
</div> </div>
<Space className="p-t-lg" direction="vertical" size={8}> <Space className="p-t-lg" direction="vertical" size={8}>
<Typography.Text> <Typography.Text>
{appData?.supportEmail && ( {appData?.supportEmail && (

View File

@ -11,6 +11,7 @@
* limitations under the License. * limitations under the License.
*/ */
import { import {
queryByTestId,
render, render,
screen, screen,
waitForElementToBeRemoved, waitForElementToBeRemoved,
@ -95,7 +96,7 @@ jest.mock('../AppLogo/AppLogo.component', () =>
describe('MarketPlaceAppDetails component', () => { describe('MarketPlaceAppDetails component', () => {
it('should render all necessary elements if app details fetch successfully', async () => { it('should render all necessary elements if app details fetch successfully', async () => {
render(<MarketPlaceAppDetails />); const { container } = render(<MarketPlaceAppDetails />);
await waitForElementToBeRemoved(() => screen.getByText('Loader')); await waitForElementToBeRemoved(() => screen.getByText('Loader'));
@ -116,6 +117,10 @@ describe('MarketPlaceAppDetails component', () => {
expect(screen.getByText('label.privacy-policy')).toBeInTheDocument(); expect(screen.getByText('label.privacy-policy')).toBeInTheDocument();
expect(screen.getByText('label.get-app-support')).toBeInTheDocument(); expect(screen.getByText('label.get-app-support')).toBeInTheDocument();
const appName = queryByTestId(container, 'appName');
expect(appName).not.toBeInTheDocument();
// actions check // actions check
userEvent.click( userEvent.click(
screen.getByRole('button', { name: 'left label.browse-app-plural' }) screen.getByRole('button', { name: 'left label.browse-app-plural' })