@@ -3,24 +3,24 @@ import { describe, it } from 'node:test';
33
44import { transformHeadingNode } from '../buildContent.mjs' ;
55
6- describe ( 'transformHeadingNode (deprecation Type -> AlertBox level)' , ( ) => {
7- const makeHeading = ( ) => ( {
8- type : 'heading' ,
9- depth : 3 ,
10- data : { type : 'misc' , slug : 's' , text : 'Heading' } ,
11- children : [ { type : 'text' , value : 'Heading' } ] ,
12- } ) ;
6+ const heading = {
7+ type : 'heading' ,
8+ depth : 3 ,
9+ data : { type : 'misc' , slug : 's' , text : 'Heading' } ,
10+ children : [ { type : 'text' , value : 'Heading' } ] ,
11+ } ;
1312
14- const makeParent = typeText => ( {
15- children : [
16- makeHeading ( ) ,
17- {
18- type : 'paragraph' ,
19- children : [ { type : 'text' , value : `Type: ${ typeText } ` } ] ,
20- } ,
21- ] ,
22- } ) ;
13+ const makeParent = typeText => ( {
14+ children : [
15+ heading ,
16+ {
17+ type : 'paragraph' ,
18+ children : [ { type : 'text' , value : `Type: ${ typeText } ` } ] ,
19+ } ,
20+ ] ,
21+ } ) ;
2322
23+ describe ( 'transformHeadingNode (deprecation Type -> AlertBox level)' , ( ) => {
2424 it ( 'maps documentation/compilation to info' , ( ) => {
2525 const entry = { api : 'deprecations' } ;
2626 const parent = makeParent ( 'Documentation' ) ;
@@ -57,9 +57,9 @@ describe('transformHeadingNode (deprecation Type -> AlertBox level)', () => {
5757 transformHeadingNode ( entry , { } , node , 0 , parent ) ;
5858
5959 const alert = parent . children [ 1 ] ;
60- assert . equal ( alert . name , 'AlertBox' ) ;
6160 const levelAttr = alert . attributes . find ( a => a . name === 'level' ) ;
62- assert . ok ( levelAttr ) ;
61+
62+ assert . equal ( alert . name , 'AlertBox' ) ;
6363 assert . equal ( levelAttr . value , 'danger' ) ;
6464 } ) ;
6565} ) ;
0 commit comments