Fix homeFeed flaky spec

This commit is contained in:
Mac Siri 2023-03-02 12:50:45 -05:00
parent 627cb203f6
commit 670d82ac3b

View file

@ -5,19 +5,20 @@ describe('Logged out Home feed', () => {
});
it("shows a profile preview card for an article's author", () => {
cy.findAllByRole('button', { name: 'Admin McAdmin profile details' })
cy.get('[aria-label="Admin McAdmin profile details"]')
.first()
.as('previewButton');
cy.get('@previewButton').should('have.attr', 'data-initialized');
cy.get('@previewButton').click();
cy.get('@previewButton').should('have.attr', 'aria-expanded', 'true');
cy.findAllByTestId('profile-preview-card')
cy.get('[aria-expanded="true"]')
.siblings('div')
.first()
.within(() => {
// TODO: check for focus here.
cy.findByRole('link', {
name: 'Admin McAdmin',
});
}).should('have.focus');
// Check all the expected user data sections are present
cy.findByText('Admin user summary');