File tree Expand file tree Collapse file tree 3 files changed +31
-3
lines changed
packages/webapp/cypress/support Expand file tree Collapse file tree 3 files changed +31
-3
lines changed Original file line number Diff line number Diff line change @@ -86,6 +86,7 @@ registerDocumentValidator()
8686type SelectionLevel = 'element' | 'parent' | 'section' | 'heading' | 'list' | 'document'
8787
8888declare global {
89+ // eslint-disable-next-line @typescript-eslint/no-namespace
8990 namespace Cypress {
9091 interface Chainable {
9192 clearEditor ( title ?: string , sentencesCount ?: number ) : Chainable < Element >
@@ -181,6 +182,27 @@ declare global {
181182 logResults : boolean
182183 } ) : Chainable < { valid : boolean ; errors : string [ ] ; structure : any [ ] } >
183184
185+ // Schema validators (from schemaValidator.js)
186+ validateDocumentSchema ( ) : Chainable < {
187+ valid : boolean
188+ errors : string [ ]
189+ errorCount ?: number
190+ skipped ?: boolean
191+ } >
192+ assertValidSchema ( ) : Chainable < void >
193+ logDocumentStructure ( ) : Chainable < void >
194+
195+ // DOM Schema validators (from domSchemaValidator.js)
196+ validateDOMSchema ( ) : Chainable < {
197+ valid : boolean
198+ errors : string [ ]
199+ errorCount : number
200+ structure : any [ ]
201+ } >
202+ assertValidDOMSchema ( ) : Chainable < void >
203+ logDOMStructure ( ) : Chainable < void >
204+ assertFullSchemaValid ( ) : Chainable < void >
205+
184206 createSelection ( options : {
185207 editorSelector ?: string
186208 startSection ?: string | number | { title : string }
@@ -1238,6 +1260,7 @@ Cypress.Commands.add(
12381260// =============================================================================
12391261
12401262declare global {
1263+ // eslint-disable-next-line @typescript-eslint/no-namespace
12411264 namespace Cypress {
12421265 interface Chainable {
12431266 /**
Original file line number Diff line number Diff line change @@ -59,8 +59,10 @@ afterEach(function () {
5959 pmResult . errors . forEach ( ( err ) => cy . log ( ` ${ err } ` ) )
6060
6161 // STRICT: Fail the test
62- expect ( pmResult . valid , `ProseMirror Schema invalid:\n${ pmResult . errors . join ( '\n' ) } ` ) . to . be
63- . true
62+ expect (
63+ pmResult . valid ,
64+ `ProseMirror Schema invalid:\n${ pmResult . errors . join ( '\n' ) } `
65+ ) . to . equal ( true )
6466 }
6567 } )
6668
@@ -78,7 +80,9 @@ afterEach(function () {
7880 } )
7981
8082 // STRICT: Fail the test
81- expect ( domResult . valid , `DOM Schema invalid:\n${ domResult . errors . join ( '\n' ) } ` ) . to . be . true
83+ expect ( domResult . valid , `DOM Schema invalid:\n${ domResult . errors . join ( '\n' ) } ` ) . to . equal (
84+ true
85+ )
8286 }
8387 } )
8488 } )
Original file line number Diff line number Diff line change 1+ /* eslint-disable no-undef */
12import { LoremIpsum } from 'lorem-ipsum'
23
34// Create singleton instance with configuration
You can’t perform that action at this time.
0 commit comments