Skip to content

Commit

Permalink
add test for teaser block
Browse files Browse the repository at this point in the history
  • Loading branch information
tedw87 committed Sep 27, 2024
1 parent 361262a commit ead2ee9
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions packages/volto/cypress/tests/core/basic/a11y.js
Original file line number Diff line number Diff line change
Expand Up @@ -122,6 +122,40 @@ describe('Accessibility Tests', () => {
cy.checkA11y();
});

it('Teaser block has no a11y violations', () => {
cy.autologin();
cy.createContent({
contentType: 'Document',
contentId: 'a11y-teaser-block',
contentTitle: 'a11y teaser block',
});
cy.createContent({
contentType: 'Document',
contentId: 'blue-orchids',
contentTitle: 'Blue Orchids',
contentDescription: 'are growing on the mountain tops',
image: true,
path: '/a11y-teaser-block',
});
cy.visit('/a11y-teaser-block/edit');
// Add a teaser block
cy.get('.block .slate-editor [contenteditable=true]').click();
cy.get('.button .block-add-button').click({ force: true });
cy.get('.blocks-chooser .mostUsed .button.teaser')
.contains('Teaser')
.click({ force: true });
cy.get(
'.objectbrowser-field[aria-labelledby="fieldset-default-field-label-href"] button[aria-label="Open object browser"]',
).click();
cy.get('[aria-label="Select Blue Orchids"]').dblclick();
cy.wait(500);
cy.get('.align-buttons .ui.buttons button[aria-label="Center"]').click();
cy.get('#toolbar-save').click();
cy.wait(1000);
cy.injectAxe();
cy.checkA11y();
});

// TODO: Update video block
// a11y tests are failing because placeholder image has no alt attribute.
// Embed component from semantic-ui doesn't accept alt property.
Expand Down

0 comments on commit ead2ee9

Please sign in to comment.