Skip to content

Commit

Permalink
fix: update text for import page
Browse files Browse the repository at this point in the history
  • Loading branch information
Mohammed Saud committed Oct 31, 2023
1 parent aac31b4 commit bafefbf
Show file tree
Hide file tree
Showing 5 changed files with 13 additions and 6 deletions.
2 changes: 1 addition & 1 deletion integration-tests/support/constants/PageTitle.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
export const pageTitles = {
applications: 'Applications',
createApp: 'Grab some code',
createApp: 'Create an application',
sampleStart: 'Start with a sample',
reviewComponent: 'Review your new components',
deploymentSettings: 'Edit deployment settings',
Expand Down
6 changes: 6 additions & 0 deletions src/components/ImportForm/GitImportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ import {
StackItem,
Bullseye,
Title,
Text,
Form,
Divider,
} from '@patternfly/react-core';
Expand Down Expand Up @@ -199,6 +200,11 @@ const GitImportForm: React.FunctionComponent<GitImportFormProps> = ({
{reviewMode ? 'Review and configure for deployment' : 'Bring in your own code'}
</Title>
</Bullseye>
{!reviewMode && (
<Bullseye>
<Text>You provide the code and we&apos;ll create an application.</Text>
</Bullseye>
)}
</StackItem>
</Stack>
</PageSection>
Expand Down
4 changes: 2 additions & 2 deletions src/components/ImportForm/ImportForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,15 +18,15 @@ const ImportForm: React.FunctionComponent<ImportFormProps> = ({ applicationName

const applicationBreadcrumbs = useApplicationBreadcrumbs(applicationName);

const title = reviewMode ? 'Configure your components for deployment' : 'Grab some code';
const title = reviewMode ? 'Configure your components for deployment' : 'Create an application';
const description = reviewMode
? 'Review and define deployment settings and options.'
: 'Provide a link to your GitHub repository or start with a no-fail sample.';
const helpId = reviewMode ? 'rhtap-import-configure-component' : 'rhtap-import-add-component';

return (
<PageLayout
breadcrumbs={[...applicationBreadcrumbs, { path: '#', name: 'Import' }]}
breadcrumbs={[...applicationBreadcrumbs, { path: '#', name: 'Create an application' }]}
title={title}
description={
<>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@ describe('GitImportForm rendering', () => {

screen.getByTestId('source-section');
screen.getByText('Bring in your own code');
screen.getByText("You provide the code and we'll create an application.");
screen.getByRole('button', { name: 'Import code' });
});

Expand Down
6 changes: 3 additions & 3 deletions src/components/ImportForm/__tests__/ImportForm.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import React from 'react';
import { render, screen, configure, waitFor } from '@testing-library/react';
import { render, screen, configure, waitFor, within } from '@testing-library/react';
import { useApplicationBreadcrumbs } from '../../../utils/breadcrumb-utils';
import ImportForm from '../ImportForm';
import '@testing-library/jest-dom';
Expand Down Expand Up @@ -43,13 +43,13 @@ describe('ImportForm', () => {

it('should render correct title and description for source section', () => {
render(<ImportForm applicationName="my-app" />);
screen.getByText('Grab some code');
screen.getByRole('heading', { name: 'Create an application' });
screen.getByText('Provide a link to your GitHub repository or start with a no-fail sample.');
});

it('should change the title and description for review mode', async () => {
render(<ImportForm applicationName="my-app" />);
screen.getByText('Grab some code');
within(screen.getByRole('navigation')).getByText('Create an application');
screen.getByText('Provide a link to your GitHub repository or start with a no-fail sample.');

await waitFor(() => screen.getByTestId('submit-button').click());
Expand Down

0 comments on commit bafefbf

Please sign in to comment.