Skip to content
This repository has been archived by the owner on Nov 28, 2022. It is now read-only.

Commit

Permalink
Update test
Browse files Browse the repository at this point in the history
  • Loading branch information
kanadgupta committed Apr 22, 2019
1 parent 0ffa854 commit 66a0025
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 11 deletions.
8 changes: 4 additions & 4 deletions packages/markdown/__tests__/__snapshots__/index.test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,10 @@ exports[`anchors 1`] = `
`;
exports[`anchors with baseUrl 1`] = `
"<p><a href=\\"/child/v1.0/docs/slug\\" target=\\"_self\\" class=\\"doc-link\\" data-sidebar=\\"slug\\">doc</a><br/>
<a href=\\"/child/v1.0/reference-link/slug\\" target=\\"_self\\">ref</a><br/>
<a href=\\"/child/v1.0/blog/slug\\" target=\\"_self\\">blog</a><br/>
<a href=\\"/child/v1.0/page/slug\\" target=\\"_self\\">page</a><br/>
"<p><a href=\\"/child/v1.0/docs/slug\\" target=\\"_self\\" class=\\"doc-link\\" data-sidebar=\\"slug\\">doc</a><br>
<a href=\\"/child/v1.0/reference-link/slug\\" target=\\"_self\\">ref</a><br>
<a href=\\"/child/v1.0/blog/slug\\" target=\\"_self\\">blog</a><br>
<a href=\\"/child/v1.0/page/slug\\" target=\\"_self\\">page</a><br>
</p>"
`;
Expand Down
19 changes: 12 additions & 7 deletions packages/markdown/__tests__/index.test.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
const { shallow } = require('enzyme');
const { shallow, mount } = require('enzyme');
const React = require('react');
const BaseUrlContext = require('../contexts/BaseUrl');

const markdown = require('../');

Expand Down Expand Up @@ -65,20 +67,23 @@ test('anchors', () => {
});

test('anchors with baseUrl', () => {
const opts = { baseUrl: '/child/v1.0' };
expect(
shallow(
const wrapper = mount(
React.createElement(
BaseUrlContext.Provider,
{
value: '/child/v1.0',
},
markdown(
`
[doc](doc:slug)
[ref](ref:slug)
[blog](blog:slug)
[page](page:slug)
`,
opts,
),
).html(),
).toMatchSnapshot();
),
);
expect(wrapper.html()).toMatchSnapshot();
});

test('emojis', () => {
Expand Down

0 comments on commit 66a0025

Please sign in to comment.