Skip to content

Commit 64410f9

Browse files
arieloOjsamr
authored andcommitted
test: add regression test for anchor without href when baseUrl is set
- see fix: ARenderer TypeError when href is undefined (2c6f82a)
1 parent 257d824 commit 64410f9

File tree

1 file changed

+23
-0
lines changed

1 file changed

+23
-0
lines changed
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
import React from 'react';
2+
import { render } from '@testing-library/react-native';
3+
import RenderHTML from '../RenderHTML';
4+
5+
/**
6+
* https://github.com/native-html/render/pull/32
7+
*/
8+
describe('RenderHTML component', () => {
9+
describe('should pass regression #32 regarding anchor without href when baseUrl is provided', () => {
10+
it('should mount without throwing', () => {
11+
const { getByText } = render(
12+
<RenderHTML
13+
debug={false}
14+
source={{
15+
html: '<a>link label</a>',
16+
baseUrl: 'https://example.com/'
17+
}}
18+
/>
19+
);
20+
expect(getByText('link label')).toBeTruthy();
21+
});
22+
});
23+
});

0 commit comments

Comments
 (0)