diff --git a/tests/model/schema.js b/tests/model/schema.js index 890341eb6..b02a606c8 100644 --- a/tests/model/schema.js +++ b/tests/model/schema.js @@ -1121,7 +1121,7 @@ describe( 'Schema', () => { schema.extend( '$text', { allowIn: '$root' } ); } ); - function test( input, attribute, output ) { + function testValidRangesForAttribute( input, attribute, output ) { setData( model, input ); const validRanges = schema.getValidRanges( doc.selection.getRanges(), attribute ); @@ -1133,7 +1133,7 @@ describe( 'Schema', () => { it( 'should return a range with p for an attribute allowed only on p', () => { schema.extend( 'p', { allowAttributes: 'foo' } ); - test( + testValidRangesForAttribute( '[
foobar
]', 'foo', '[foobar
]' @@ -1143,7 +1143,7 @@ describe( 'Schema', () => { it( 'should return ranges on text nodes for an attribute allowed only on text', () => { schema.extend( '$text', { allowAttributes: 'bold' } ); - test( + testValidRangesForAttribute( '[foobar
]', 'bold', '[foo][bar]
' @@ -1153,7 +1153,7 @@ describe( 'Schema', () => { it( 'should return a range on img for an attribute allowed only on img', () => { schema.extend( 'img', { allowAttributes: 'src' } ); - test( + testValidRangesForAttribute( '[foobar
]', 'src', 'foo[]bar
' @@ -1164,7 +1164,7 @@ describe( 'Schema', () => { schema.extend( '$text', { allowAttributes: 'bold' } ); schema.extend( 'img', { allowAttributes: 'bold' } ); - test( + testValidRangesForAttribute( '[foobar
]', 'bold', '[foobar]
' @@ -1192,7 +1192,7 @@ describe( 'Schema', () => { it( 'should not break a range if children are not allowed to have the attribute', () => { schema.extend( 'p', { allowAttributes: 'foo' } ); - test( + testValidRangesForAttribute( '[foo
bar
]', 'foo', '[foo
bar
]' @@ -1202,7 +1202,7 @@ describe( 'Schema', () => { it( 'should search deeply', () => { schema.extend( '$text', { allowAttributes: 'bold', allowIn: 'img' } ); - test( + testValidRangesForAttribute( '[fooxxxbar
]', 'bold', '[foo][xxx][bar]
' @@ -1212,7 +1212,7 @@ describe( 'Schema', () => { it( 'should work with multiple ranges', () => { schema.extend( '$text', { allowAttributes: 'bold' } ); - test( + testValidRangesForAttribute( '[a
b
]c
[d]
', 'bold', '[a]
[b]
c
[d]
' @@ -1222,7 +1222,7 @@ describe( 'Schema', () => { it( 'should work with non-flat ranges', () => { schema.extend( '$text', { allowAttributes: 'bold' } ); - test( + testValidRangesForAttribute( '[a
b
c]
d
', 'bold', '[a]
[b]
[c]
d
' @@ -1232,7 +1232,7 @@ describe( 'Schema', () => { it( 'should not leak beyond the given ranges', () => { schema.extend( '$text', { allowAttributes: 'bold' } ); - test( + testValidRangesForAttribute( '[foo
b]a[r
x]yz
', 'bold', '[foo]
[b]a[r]
[x]yz
' @@ -1249,7 +1249,7 @@ describe( 'Schema', () => { } } ); - test( + testValidRangesForAttribute( '[fooxx]xbar
', 'bold', '[foo]xxxbar
'