Skip to content

Commit

Permalink
Change button label (#426)
Browse files Browse the repository at this point in the history
* updated the text from Create to Deploy

* added newley built index.js

* updated text in test to read Deploy App

* updated python integration test with updated label

* updated the other Create App button at end of form with Deploy App, updated tests

---------

Co-authored-by: Kilian Berres <kberres@ITLP01061.local>
  • Loading branch information
kildre and Kilian Berres authored Jul 31, 2024
1 parent a55f8a6 commit 43547b0
Show file tree
Hide file tree
Showing 8 changed files with 18 additions and 18 deletions.
4 changes: 2 additions & 2 deletions jhub_apps/static/js/index.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions jhub_apps/tests/tests_e2e/test_integration.py
Original file line number Diff line number Diff line change
Expand Up @@ -87,7 +87,7 @@ def create_app(
share_with_groups=None,
):
logger.info("Creating App")
page.get_by_role("button", name="Create App").click()
page.get_by_role("button", name="Deploy App").click()
logger.info("Fill App display Name")
page.get_by_label("*Name").click()
page.get_by_label("*Name").fill(app_name)
Expand All @@ -106,10 +106,10 @@ def create_app(
logger.info("Expect Small Instance to be visible")
expect(small_instance_radio_button).to_be_visible()
small_instance_radio_button.check()
create_app_locator = page.get_by_role("button", name="Create App")
logger.info("Expect Create App button to be visible")
create_app_locator = page.get_by_role("button", name="Deploy App")
logger.info("Expect Deploy App button to be visible")
expect(create_app_locator).to_be_visible()
logger.info("Click Create App")
logger.info("Click Deploy App")
create_app_locator.click()


Expand Down
12 changes: 6 additions & 6 deletions ui/src/components/app-form/app-form.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -147,7 +147,7 @@ describe('AppForm', () => {
// Attempt submitting without filling in required fields
const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down Expand Up @@ -283,7 +283,7 @@ describe('AppForm', () => {
// Attempt submitting without filling in required fields
const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down Expand Up @@ -353,7 +353,7 @@ describe('AppForm', () => {
// Attempt submitting without filling in required fields
const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down Expand Up @@ -410,7 +410,7 @@ describe('AppForm', () => {

const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down Expand Up @@ -556,7 +556,7 @@ describe('AppForm', () => {

const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down Expand Up @@ -726,7 +726,7 @@ describe('AppForm', () => {

const btn = baseElement.querySelector('#submit-btn') as HTMLButtonElement;
expect(btn).toBeInTheDocument();
expect(btn).toHaveTextContent('Create App');
expect(btn).toHaveTextContent('Deploy App');
expect(btn).not.toHaveAttribute('disabled', 'disabled');
await act(async () => {
btn.click();
Expand Down
2 changes: 1 addition & 1 deletion ui/src/components/app-form/app-form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -948,7 +948,7 @@ export const AppForm = ({ id }: AppFormProps): React.ReactElement => {
) : id ? (
<>Save</>
) : (
<>Create App</>
<>Deploy App</>
)}
</Button>
</div>
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/home/apps-section/apps-section.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -201,7 +201,7 @@ export const AppsSection = (): React.ReactElement => {
window.location.href = `${API_BASE_URL}/create-app`;
}}
>
Create App
Deploy App
</Button>
</Item>
</Grid>
Expand Down
4 changes: 2 additions & 2 deletions ui/src/pages/home/home.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -67,10 +67,10 @@ describe('Home', () => {
});
});

test('should render create app button and respond to click events', async () => {
test('should render Deploy app button and respond to click events', async () => {
const { getByText } = render(componentWrapper);
await act(async () => {
const button = getByText('Create App');
const button = getByText('Deploy App');
expect(button).toBeTruthy();
fireEvent.click(button);
});
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/server-types/server-types.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -214,7 +214,7 @@ describe('ServerTypes', () => {
mockSearchParamsGet.mockRestore();
});

test('clicks back to create app', async () => {
test('clicks back to deploy app', async () => {
jest.mock('react-router-dom', () => ({
...jest.requireActual('react-router-dom'),
useLocation: () => ({
Expand Down
2 changes: 1 addition & 1 deletion ui/src/pages/server-types/server-types.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -299,7 +299,7 @@ export const ServerTypes = (): React.ReactElement => {
color="primary"
loading={submitting}
>
{id ? 'Save' : 'Create App'}
{id ? 'Save' : 'Deploy App'}
</LoadingButton>
</div>
</div>
Expand Down

0 comments on commit 43547b0

Please sign in to comment.