3
0
mirror of https://github.com/larvit/adf-codec.git synced 2026-11-19 06:35:44 +01:00

32 - the deeper helpers read the one limit, and the code directive's refusal is tested

This commit is contained in:
2026-09-23 22:51:03 +02:00
parent 2799c30389
commit 3f0bcb3b47
2 changed files with 5 additions and 4 deletions
+1 -2
View File
@@ -61,8 +61,7 @@ test('rejects a node whose shape ProseMirror JSON cannot hold', () => {
})
test('names the attribute nesting past the levels the parser reads one at, and still calls the value a document', () => {
const deeper = (key: string, type: string, levels: number = largestNesting): string =>
`the ${key} attribute of ${type} nests deeper than the ${levels} levels an attribute carries`
const deeper = (key: string, type: string): string => `the ${key} attribute of ${type} nests deeper than the ${largestNesting} levels an attribute carries`
assert.equal(fault(withAttribute(nested(largestNesting))), 'accepted')
assert.equal(fault(withAttribute(nested(largestNesting + 1))), deeper('a', 'paragraph'))
assert.equal(faultCode(withAttribute(nested(largestNesting + 1))), 'unsupported-nesting-depth')