Skip to content

Commit

Permalink
rename to choose an os in linode create flow
Browse files Browse the repository at this point in the history
  • Loading branch information
hana-linode committed Jun 7, 2024
1 parent d4139ad commit 3af4950
Show file tree
Hide file tree
Showing 5 changed files with 34 additions and 35 deletions.
3 changes: 1 addition & 2 deletions packages/manager/cypress/support/ui/constants.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ export interface Page {
// List of Routes and validator of the route
export const pages: Page[] = [
{
assertIsLoaded: () =>
cy.findByText('Choose a Distribution').should('be.visible'),
assertIsLoaded: () => cy.findByText('Choose an OS').should('be.visible'),
goWithUI: [
{
go: () => {
Expand Down
60 changes: 30 additions & 30 deletions packages/manager/cypress/support/ui/pages/linode-create-page.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,33 +8,13 @@ import { ui } from 'support/ui';
* Page utilities for interacting with the Linode create page.
*/
export const linodeCreatePage = {
/**
* Sets the Linode's label.
*
* @param linodeLabel - Linode label to set.
*/
setLabel: (linodeLabel: string) => {
cy.findByLabelText('Linode Label').type(`{selectall}{del}${linodeLabel}`);
},

/**
* Sets the Linode's root password.
*
* @param linodePassword - Root password to set.
*/
setRootPassword: (linodePassword: string) => {
cy.findByLabelText('Root Password').as('rootPasswordField').click();

cy.get('@rootPasswordField').type(linodePassword, { log: false });
},

/**
* Selects the Image with the given name.
*
* @param imageName - Name of Image to select.
*/
selectImage: (imageName: string) => {
cy.findByText('Choose a Distribution')
cy.findByText('Choose an OS')
.closest('[data-qa-paper]')
.within(() => {
ui.autocomplete.find().click();
Expand All @@ -46,15 +26,6 @@ export const linodeCreatePage = {
});
},

/**
* Select the Region with the given ID.
*
* @param regionId - ID of Region to select.
*/
selectRegionById: (regionId: string) => {
ui.regionSelect.find().click().type(`${regionId}{enter}`);
},

/**
* Select the given Linode plan.
*
Expand Down Expand Up @@ -91,4 +62,33 @@ export const linodeCreatePage = {
cy.get('@selectionCard').click();
});
},

/**
* Select the Region with the given ID.
*
* @param regionId - ID of Region to select.
*/
selectRegionById: (regionId: string) => {
ui.regionSelect.find().click().type(`${regionId}{enter}`);
},

/**
* Sets the Linode's label.
*
* @param linodeLabel - Linode label to set.
*/
setLabel: (linodeLabel: string) => {
cy.findByLabelText('Linode Label').type(`{selectall}{del}${linodeLabel}`);
},

/**
* Sets the Linode's root password.
*
* @param linodePassword - Root password to set.
*/
setRootPassword: (linodePassword: string) => {
cy.findByLabelText('Root Password').as('rootPasswordField').click();

cy.get('@rootPasswordField').type(linodePassword, { log: false });
},
};
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ describe('Distributions', () => {
component: <Distributions />,
});

const header = getByText('Choose a Distribution');
const header = getByText('Choose an OS');

expect(header).toBeVisible();
expect(header.tagName).toBe('H2');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ export const Distributions = () => {

return (
<Paper>
<Typography variant="h2">Choose a Distribution</Typography>
<Typography variant="h2">Choose an OS</Typography>
<ImageSelectv2
disabled={isCreateLinodeRestricted}
errorText={fieldState.error?.message}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -543,7 +543,7 @@ export class LinodeCreate extends React.PureComponent<
<FromImageContent
accountBackupsEnabled={accountBackupsEnabled}
error={hasErrorFor.image}
imagePanelTitle="Choose a Distribution"
imagePanelTitle="Choose an OS"
imagesData={imagesData!}
regionsData={regionsData!}
typesData={typesData!}
Expand Down

0 comments on commit 3af4950

Please sign in to comment.