Skip to content

Commit

Permalink
Add a test case that includes a mailto link
Browse files Browse the repository at this point in the history
  • Loading branch information
sistrall committed Mar 21, 2023
1 parent d4303d5 commit e82e584
Show file tree
Hide file tree
Showing 2 changed files with 43 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
// Jest Snapshot v1, https://goo.gl/fbAQLP

exports[`StructuredText dast including a mailto: link with default rules renders the document 1`] = `
<div>
<p><a href="mailto:test@tests.com">test@test.com</a></p>
</div>
`;

exports[`StructuredText simple dast /2 with default rules renders the document 1`] = `
<div>
<h1>This<br>is a<br>title!</h1><pre data-language="javascript"><code>function greetings() {
Expand Down
38 changes: 37 additions & 1 deletion src/components/StructuredText/__tests__/index.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ describe('StructuredText', () => {
expect(() => {
mount(StructuredText, {
propsData: { data: structuredText },
});
});
}).toThrow(RenderError);
});
});
Expand All @@ -264,4 +264,40 @@ describe('StructuredText', () => {
});
});
});

describe('dast including a mailto: link', () => {
const structuredText: StructuredTextDocument = {
schema: 'dast',
document: {
type: 'root',
children: [
{
type: 'paragraph',
children: [
{
url: 'mailto:test@tests.com',
type: 'link',
children: [
{
type: 'span',
value: 'test@test.com',
},
],
},
],
},
],
},
};

describe('with default rules', () => {
it('renders the document', () => {
const wrapper = mount(StructuredText, {
propsData: { data: structuredText },
});
// await wrapper.vm.$nextTick();
expect(wrapper.html()).toMatchSnapshot();
});
});
});
});

4 comments on commit e82e584

@vercel
Copy link

@vercel vercel bot commented on e82e584 Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-datocms-vite-typescript-vue3-example – ./examples/vite-typescript-vue3

vue-datocms-vite-typescript-vue3-example.vercel.app
vue-datocms-vite-typescript-vue3-example-git-master-datocms.vercel.app
vue-datocms-vite-typescript-vue3-example-datocms.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e82e584 Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-datocms-site-search-example – ./examples/site-search

vue-datocms-site-search-example-git-master-datocms.vercel.app
vue-datocms-site-search-example-datocms.vercel.app
vue-datocms-site-search-example.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e82e584 Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-datocms-query-subscription-example – ./examples/query-subscription

vue-datocms-query-subscription-example-git-master-datocms.vercel.app
vue-datocms-query-subscription-example-datocms.vercel.app
vue-datocms-query-subscription-example.vercel.app

@vercel
Copy link

@vercel vercel bot commented on e82e584 Mar 21, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

vue-datocms-vue-cli-babel-javascript-vue2-example – ./examples/vue-cli-babel-javascript-vue2

vue-datocms-vue-cli-babel-javascript-vue2-example.vercel.app
vue-datocms-vue-cli-babel-javascript-vue2-example-datocms.vercel.app
vue-datocms-vue-cli-babel-javascript-vue2-ex-git-00872c-datocms.vercel.app

Please sign in to comment.