-
-
Notifications
You must be signed in to change notification settings - Fork 756
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'master' into fixheaderlevelinlisting
* master: Release 17.0.0-alpha.14 Linked headlines (#3540) Release notes for 16.20.8 16.21.0 16.21.1 (#4910) Spanish translation (#4896) Refactor Anontools (#4845) Update to plone-backend 6.0.5 (#4897) Release 17.0.0-alpha.13 Enforce max upload size (#4868) Fix and improve the `addStyling` helper (#4880) Release 17.0.0-alpha.12 Fix regression in horizontal scroll in contents view, add it back (#4872) Configurable Container component from registry for some key route views. (#4871) Allow to deselect color in ColorPickerWidget. (#4839) Release 17.0.0-alpha.11 Pagination with router params (#4698) Release 17.0.0-alpha.10 feat(slate): Add css identifier to slate style menu options (#4847) Update Brazilian Portuguese translations (Fixes #4853) Convert header class to function (#4767)
- Loading branch information
Showing
84 changed files
with
1,837 additions
and
394 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
import { slateBeforeEach } from '../../../support/volto-slate'; | ||
|
||
describe('Block Tests: Anchors', () => { | ||
beforeEach(slateBeforeEach); | ||
|
||
it('Add Block: Links', () => { | ||
// Change page title | ||
cy.clearSlateTitle(); | ||
cy.getSlateTitle().type('Slate Heading Anchors'); | ||
cy.getSlate().click(); | ||
|
||
// Add TOC block | ||
cy.get('.ui.basic.icon.button.block-add-button').first().click(); | ||
cy.get(".blocks-chooser .ui.form .field.searchbox input[type='text']").type( | ||
'table of contents', | ||
); | ||
cy.get('.button.toc').click(); | ||
|
||
// Save page | ||
cy.get('#toolbar-save').click(); | ||
cy.url().should('eq', Cypress.config().baseUrl + '/my-page'); | ||
cy.get('h1.documentFirstHeading') | ||
.trigger('mouseover', { eventConstructor: 'MouseEvent' }) | ||
.children() | ||
.should('have.length', 1); | ||
}); | ||
|
||
it('Add Block: add content to TOC', () => { | ||
// Change page title | ||
cy.clearSlateTitle(); | ||
cy.getSlateTitle().type('Slate Heading Anchors'); | ||
cy.getSlate().click(); | ||
|
||
// Add TOC block | ||
cy.get('.ui.basic.icon.button.block-add-button').first().click(); | ||
cy.get(".blocks-chooser .ui.form .field.searchbox input[type='text']").type( | ||
'table of contents', | ||
); | ||
cy.get('.button.toc').click(); | ||
|
||
// Add headings | ||
cy.get('.ui.drag.block.inner.slate').click().type('Title 1').click(); | ||
cy.get('.ui.drag.block.inner.slate span span span').setSelection('Title 1'); | ||
cy.get('.slate-inline-toolbar .button-wrapper a[title="Title"]').click({ | ||
force: true, | ||
}); | ||
cy.get('.ui.drag.block.inner.slate').click().type('{enter}'); | ||
|
||
cy.get('.ui.drag.block.inner.slate').eq(1).click().type('Title 2').click(); | ||
cy.get('.ui.drag.block.inner.slate span span span') | ||
.eq(1) | ||
.setSelection('Title 2'); | ||
cy.get('.slate-inline-toolbar .button-wrapper a[title="Title"]').click({ | ||
force: true, | ||
}); | ||
cy.get('.ui.drag.block.inner.slate').eq(1).click().type('{enter}'); | ||
|
||
// Save page | ||
cy.get('#toolbar-save').click(); | ||
cy.url().should('eq', Cypress.config().baseUrl + '/my-page'); | ||
|
||
// Check if the page contains the TOC and scrolls to each entry on click | ||
cy.contains('Slate Heading Anchors'); | ||
cy.get('h2[id="title-1"]').contains('Title 1'); | ||
cy.get('h2[id="title-2"]').contains('Title 2'); | ||
cy.get('a[href="#title-1"]').click(); | ||
cy.get('h2[id="title-1"]').scrollIntoView().should('be.visible'); | ||
cy.get('a[href="#title-2"]').click(); | ||
cy.get('h2[id="title-2"]').scrollIntoView().should('be.visible'); | ||
}); | ||
}); |
Oops, something went wrong.