Page Menu
Home
Sealhub
Search
Configure Global Search
Log In
Files
F996409
jdd.test.ts
No One
Temporary
Actions
Download File
Edit File
Delete File
View Transforms
Subscribe
Mute Notifications
Award Token
Flag For Later
Size
979 B
Referenced Files
None
Subscribers
None
jdd.test.ts
View Options
import
assert
from
"assert"
;
import
{
Markdown
}
from
"./components/markdown.js"
;
import
{
JDD
}
from
"./jdd.js"
;
import
{
Registry
}
from
"./registry.js"
;
import
{
simplestContext
}
from
"./test-utils/simplest-context.js"
;
describe
(
"jdd"
,
()
=>
{
it
(
"properly extracts headings from multiple components"
,
()
=>
{
const
registry
=
new
Registry
();
registry
.
add
(
"markdown"
,
Markdown
);
const
jdd
=
JDD
.
fromParsed
(
registry
,
simplestContext
(),
[
{
component_name
:
"markdown"
,
args
:
{
markdown
:
`
# heading one
## heading two
### heading three`
,
},
},
{
component_name
:
"markdown"
,
args
:
{
markdown
:
`
# heading four
`
,
},
},
]);
assert
.
deepEqual
(
jdd
.
getHeadings
(),
[
{
text
:
"heading one"
,
level
:
1
,
slug
:
"heading-one"
},
{
text
:
"heading two"
,
level
:
2
,
slug
:
"heading-two"
},
{
text
:
"heading three"
,
level
:
3
,
slug
:
"heading-three"
},
{
text
:
"heading four"
,
level
:
1
,
slug
:
"heading-four"
},
]);
});
});
File Metadata
Details
Attached
Mime Type
text/x-java
Expires
Tue, Dec 24, 14:02 (18 h, 14 m)
Storage Engine
blob
Storage Format
Raw Data
Storage Handle
557243
Default Alt Text
jdd.test.ts (979 B)
Attached To
Mode
R130 jdd
Attached
Detach File
Event Timeline
Log In to Comment