Fix flake in preview profile spec (#14417)

This commit is contained in:
Suzanne Aitchison 2021-08-04 17:58:49 +01:00 committed by GitHub
parent c3eca46c97
commit 9b644c8c18
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -31,7 +31,7 @@ describe('Preview user profile from article page', () => {
});
});
describe.skip("Preview profile on another user's article", () => {
describe("Preview profile on another user's article", () => {
beforeEach(() => {
cy.testSetup();
cy.fixture('users/articleEditorV1User.json').as('user');
@ -134,7 +134,8 @@ describe('Preview user profile from article page', () => {
// Click the follow button in the author byline preview
cy.findAllByRole('button', { name: 'Admin McAdmin profile details' })
.first()
.click();
.as('bylinePreviewButton');
cy.get('@bylinePreviewButton').click();
cy.findAllByTestId('profile-preview-card')
.first()
@ -145,6 +146,9 @@ describe('Preview user profile from article page', () => {
cy.findByRole('button', { name: 'Following' });
});
// Close the preview card so the next preview button can be clicked
cy.get('@bylinePreviewButton').click();
// Check the follow button in the comment author preview card has updated
cy.findAllByRole('button', { name: 'Admin McAdmin profile details' })
.last()