-
Notifications
You must be signed in to change notification settings - Fork 362
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: [M3-8728] - Add Product Families to Create Menu dropdown #11260
base: develop
Are you sure you want to change the base?
feat: [M3-8728] - Add Product Families to Create Menu dropdown #11260
Conversation
|
||
import { CreateMenu } from './CreateMenu'; | ||
|
||
describe('CreateMenu', () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This file was renamed from AddNewMenu
and replaced fireEvent
with userEvent
it('renders product family headings', async () => { | ||
const { getAllByRole, getByText } = renderWithTheme(<CreateMenu />); | ||
const createButton = getByText('Create'); | ||
await userEvent.click(createButton); | ||
const headings = getAllByRole('heading', { level: 3 }); | ||
const expectedHeadings = ['Compute', 'Networking', 'Storage', 'Databases']; | ||
headings.forEach((heading, i) => { | ||
expect(heading).toHaveTextContent(expectedHeadings[i]); | ||
}); | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
New addition
const account = accountFactory.build({ | ||
capabilities: [], | ||
}); | ||
|
||
server.use( | ||
http.get('*/account', () => { | ||
return HttpResponse.json(account); | ||
}) | ||
); | ||
|
||
const { getByText, queryByText } = renderWithTheme(<CreateMenu />, { | ||
flags: { databases: false, dbaasV2: { beta: false, enabled: false } }, | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This test was failing so I added capabilities and flags to ensure isDatabasesEnabled
is false in CreateMenu
description?: string; | ||
} | ||
|
||
export const CreateMenu = () => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This component was renamed from AddNewMenu
<Stack direction="column" tabIndex={-1}> | ||
<ProductFamilyGroup | ||
handleClose={handleClose} | ||
productFamily={productFamilyLinkGroup[0]} | ||
/> | ||
</Stack> | ||
<Divider | ||
orientation="vertical" | ||
sx={{ height: 'auto', margin: 0, marginTop: 1 }} | ||
/> | ||
<Stack direction="column" tabIndex={-1}> | ||
<ProductFamilyGroup | ||
handleClose={handleClose} | ||
productFamily={productFamilyLinkGroup[1]} | ||
/> | ||
</Stack> | ||
<Divider | ||
orientation="vertical" | ||
sx={{ height: 'auto', margin: 0, marginTop: 1 }} | ||
/> |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Unit tests pass locally & in CI ✅
Tabbing and clicking through "Create Menu" dropdown items works ✅
Code review ✅
As the viewport exceeds or falls below 1280px, the section headers lose/gain a background:
Video
Screen.Recording.2024-11-18.at.12.21.18.PM.mov
It happens in dark mode too, where it's more problematic.
The background color for the individual items being so starkly different makes this look visually imbalanced IMO:
Coverage Report: ✅ |
@dwiley-akamai Good catch, addressed! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Cloud Manager UI test results🔺 6 failing tests on test run #9 ↗︎
Details
TroubleshootingUse this command to re-run the failing tests: yarn cy:run -s "cypress/e2e/core/linodes/linode-storage.spec.ts,cypress/e2e/core/linodes/linode-storage.spec.ts,cypress/e2e/core/images/machine-image-upload.spec.ts,cypress/e2e/core/images/machine-image-upload.spec.ts,cypress/e2e/core/images/machine-image-upload.spec.ts,cypress/e2e/core/images/machine-image-upload.spec.ts" |
Description 📝
Add Product Families to the Create Menu Dropdown and display the desktop dropdown as 3 columns in a row; mobile will remain as a single column dropdown
Note: The Storage section was intentionally moved after Networking (different from the Side Nav Menu) since it has less items and can be in the same column as Databases. UX would prefer not to change the Side Nav order as it "reflects the info hierarchy from Ryan McEntee, that is also being used by TechDocs."
Changes 🔄
Clean up 🧹 :
userEvent
overfireEvent
Preview 📷
Screen.Recording.2024-11-15.at.2.57.41.PM.mov
How to test 🧪
Verification steps
As an Author, I have considered 🤔
As an Author, before moving this PR from Draft to Open, I confirmed ✅