Skip to content
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

M3-6614 Add Cypress tests for Linode landing page 'Summary View' #9477

Merged
merged 2 commits into from
Aug 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -350,6 +350,43 @@ describe('linode landing checks', () => {
cy.findByText(linode.label).should('be.visible');
});
});

it('checks summary view for linode table', () => {
mockGetLinodes(mockLinodes).as('getLinodes');
cy.visitWithLogin('/linodes');
cy.wait('@getLinodes');

// Check 'Summary View' button works as expected that can be visiable, enabled and clickable
getVisible('[aria-label="Toggle display"]').should('be.enabled').click();

mockLinodes.forEach((linode) => {
cy.findByText(linode.label)
.should('be.visible')
.closest('[data-qa-linode-card]')
.within(() => {
cy.findByText('Summary').should('be.visible');
cy.findByText('IP Addresses').should('be.visible');
cy.findByText('Access').should('be.visible');

cy.findByText('Plan:').should('be.visible');
cy.findByText('Region:').should('be.visible');
cy.findByText('Linode ID:').should('be.visible');
cy.findByText('Created:').should('be.visible');
});
});

// Toggle the 'List View' button to check the display of table items are back to the original view.
getVisible('[aria-label="Toggle display"]').should('be.enabled').click();

cy.findByText('Summary').should('not.exist');
cy.findByText('IP Addresses').should('not.exist');
cy.findByText('Access').should('not.exist');

cy.findByText('Plan:').should('not.exist');
cy.findByText('Region:').should('not.exist');
cy.findByText('Linode ID:').should('not.exist');
cy.findByText('Created:').should('not.exist');
});
});

describe('linode landing actions', () => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ const CardView = (props: RenderLinodesProps) => {
<Grid className="m0" container style={{ width: '100%' }}>
{data.map((linode, idx: number) => (
<React.Fragment key={`linode-card-${idx}`}>
<StyledSummaryGrid xs={12}>
<StyledSummaryGrid xs={12} data-qa-linode-card={linode.id}>
<LinodeEntityDetail
handlers={{
onOpenDeleteDialog: () =>
Expand Down