Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Suzanne Aitchison <suzanne@forem.com>
48 lines
1.2 KiB
JavaScript
48 lines
1.2 KiB
JavaScript
describe('Moderation navigation', () => {
|
|
describe('mobile screens', () => {
|
|
beforeEach(() => {
|
|
cy.testSetup();
|
|
cy.fixture('users/adminUser.json').as('user');
|
|
|
|
cy.viewport('iphone-6');
|
|
|
|
cy.get('@user').then((user) => {
|
|
cy.loginAndVisit(user, '/mod');
|
|
});
|
|
});
|
|
|
|
it('shows all topics by default', () => {
|
|
cy.findByRole('navigation', {
|
|
name: 'Mod center inbox navigation',
|
|
}).within(() => {
|
|
cy.findByRole('link', { name: 'All topics' }).should(
|
|
'have.attr',
|
|
'aria-current',
|
|
'page',
|
|
);
|
|
cy.findByRole('link', { name: '#tag1' }).should(
|
|
'have.attr',
|
|
'aria-current',
|
|
'',
|
|
);
|
|
});
|
|
});
|
|
|
|
it('should switch tab to a tag', () => {
|
|
cy.findByRole('navigation', {
|
|
name: 'Mod center inbox navigation',
|
|
}).within(() => {
|
|
cy.findByRole('link', { name: '#tag1' }).as('tag1');
|
|
cy.get('@tag1').should('have.attr', 'aria-current', '');
|
|
cy.get('@tag1').click();
|
|
});
|
|
|
|
// Get a new handle to element as a new page has loaded
|
|
cy.findByRole('link', { name: '#tag1' }).should(
|
|
'have.attr',
|
|
'aria-current',
|
|
'page',
|
|
);
|
|
});
|
|
});
|
|
});
|