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

Commit 66a0025

Browse files
committed
Update test
1 parent 0ffa854 commit 66a0025

File tree

2 files changed

+16
-11
lines changed

2 files changed

+16
-11
lines changed

packages/markdown/__tests__/__snapshots__/index.test.js.snap

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -11,10 +11,10 @@ exports[`anchors 1`] = `
1111
`;
1212
1313
exports[`anchors with baseUrl 1`] = `
14-
"<p><a href=\\"/child/v1.0/docs/slug\\" target=\\"_self\\" class=\\"doc-link\\" data-sidebar=\\"slug\\">doc</a><br/>
15-
<a href=\\"/child/v1.0/reference-link/slug\\" target=\\"_self\\">ref</a><br/>
16-
<a href=\\"/child/v1.0/blog/slug\\" target=\\"_self\\">blog</a><br/>
17-
<a href=\\"/child/v1.0/page/slug\\" target=\\"_self\\">page</a><br/>
14+
"<p><a href=\\"/child/v1.0/docs/slug\\" target=\\"_self\\" class=\\"doc-link\\" data-sidebar=\\"slug\\">doc</a><br>
15+
<a href=\\"/child/v1.0/reference-link/slug\\" target=\\"_self\\">ref</a><br>
16+
<a href=\\"/child/v1.0/blog/slug\\" target=\\"_self\\">blog</a><br>
17+
<a href=\\"/child/v1.0/page/slug\\" target=\\"_self\\">page</a><br>
1818
</p>"
1919
`;
2020

packages/markdown/__tests__/index.test.js

Lines changed: 12 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
1-
const { shallow } = require('enzyme');
1+
const { shallow, mount } = require('enzyme');
2+
const React = require('react');
3+
const BaseUrlContext = require('../contexts/BaseUrl');
24

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

@@ -65,20 +67,23 @@ test('anchors', () => {
6567
});
6668

6769
test('anchors with baseUrl', () => {
68-
const opts = { baseUrl: '/child/v1.0' };
69-
expect(
70-
shallow(
70+
const wrapper = mount(
71+
React.createElement(
72+
BaseUrlContext.Provider,
73+
{
74+
value: '/child/v1.0',
75+
},
7176
markdown(
7277
`
7378
[doc](doc:slug)
7479
[ref](ref:slug)
7580
[blog](blog:slug)
7681
[page](page:slug)
7782
`,
78-
opts,
7983
),
80-
).html(),
81-
).toMatchSnapshot();
84+
),
85+
);
86+
expect(wrapper.html()).toMatchSnapshot();
8287
});
8388

8489
test('emojis', () => {

0 commit comments

Comments
 (0)