Skip to content

Commit

Permalink
test: add unknown mark
Browse files Browse the repository at this point in the history
  • Loading branch information
theisel committed Jul 24, 2022
1 parent 7a01031 commit a4d2a9a
Show file tree
Hide file tree
Showing 2 changed files with 31 additions and 0 deletions.
21 changes: 21 additions & 0 deletions component/test/components/fixture/src/pages/mark/unknown.astro
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
import Layout from "../../layouts/Default.astro";
import { PortableText } from "astro-portabletext";
const blocks = [
{
_type: "block",
children: [
{
_type: "span",
text: "highlighted",
marks: ["highlight"],
},
],
},
];
---

<Layout>
<PortableText value={blocks} />
</Layout>
10 changes: 10 additions & 0 deletions component/test/components/mark.test.js
Original file line number Diff line number Diff line change
Expand Up @@ -53,4 +53,14 @@ mark("underline", async () => {
assert.is($el.attr("style"), "text-decoration: underline;");
});

mark("unknown", async () => {
const $ = await fetchContent("mark/unknown");
const $el = $("[data-portabletext-unknown]");

assert.is($el.length, 1);
assert.is($el.attr("data-portabletext-unknown"), "mark");
assert.is($el.text(), "highlighted");
assert.is($el[0].name, "span");
});

mark.run();

0 comments on commit a4d2a9a

Please sign in to comment.