docbrown/cypress/e2e/seededFlows/notificationsFlows/followUserFromNotifications.spec.js
dependabot[bot] deb86efb0d
Bump cypress and @knapsack-pro/cypress (#18025)
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
2022-07-06 17:53:13 -04:00

27 lines
912 B
JavaScript

describe('Follow user from notifications', () => {
beforeEach(() => {
cy.testSetup();
cy.fixture('users/notificationsUser.json').as('user');
cy.get('@user').then((user) => {
cy.loginAndVisit(user, '/notifications');
});
});
it('Follows and unfollows a user from a follow notification', () => {
cy.findByRole('heading', { name: 'Notifications' });
cy.findByRole('button', { name: 'Follow user back: User' }).as(
'followButton',
);
cy.get('@followButton').should('have.attr', 'aria-pressed', 'false');
cy.get('@followButton').click();
cy.get('@followButton').should('have.text', 'Following');
cy.get('@followButton').should('have.attr', 'aria-pressed', 'true');
cy.get('@followButton').click();
cy.get('@followButton').should('have.text', 'Follow back');
cy.get('@followButton').should('have.attr', 'aria-pressed', 'false');
});
});