From 66a5f8bfc4794c75d218a7a56159159629527ba4 Mon Sep 17 00:00:00 2001 From: Teodor Date: Wed, 25 Sep 2024 17:30:55 +0300 Subject: [PATCH] add a11y test for text block --- .../volto/cypress/tests/core/basic/a11y.js | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) diff --git a/packages/volto/cypress/tests/core/basic/a11y.js b/packages/volto/cypress/tests/core/basic/a11y.js index c7b385011d..2afc8e7fd0 100644 --- a/packages/volto/cypress/tests/core/basic/a11y.js +++ b/packages/volto/cypress/tests/core/basic/a11y.js @@ -96,6 +96,25 @@ describe('Accessibility Tests', () => { cy.checkA11y(); }); + it('Text block has no a11y violations', () => { + cy.createContent({ + contentType: 'Document', + contentId: 'a11y-text-block', + contentTitle: 'a11y text block', + }); + cy.visit('/a11y-text-block/edit'); + // Add a text block + cy.get('.block .slate-editor [contenteditable=true]').click(); + cy.get('.button .block-add-button').click({ force: true }); + cy.get('[aria-label="Unfold Text blocks"]').click(); + cy.get('.blocks-chooser .slate').findByText('Text').click({ force: true }); + cy.getSlateEditorAndType('My text').contains('My text'); + cy.get('#toolbar-save').click(); + cy.wait(1000); + cy.injectAxe(); + cy.checkA11y(); + }); + // TODO: Adapt this to volto-slate table // it('Table has no a11y violations', () => { // cy.createContent({