Skip to content

Commit 7cfed74

Browse files
committed
refactor: rename test file for GithubHtmlView component
1 parent 1ac9a81 commit 7cfed74

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

__tests__/tests/components/github-htmlview.js renamed to __tests__/tests/components/GithubHtmlView.js

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ import { GithubHtmlView } from 'components';
55
import { Icon } from 'react-native-elements';
66

77
describe('<GithubHtmlView />', () => {
8-
it('correctly renders <details/> tag in GithubHtmlView', () => {
8+
it('correctly renders <details/> tag in GithubHtmlView with correct icon', () => {
99
const sourceHtml = `
1010
<details>
1111
<summary>title</summary>
@@ -17,8 +17,6 @@ describe('<GithubHtmlView />', () => {
1717
<GithubHtmlView source={sourceHtml} onLinkPress={() => 0} />
1818
);
1919

20-
// we should be able to find a <Icon/> with proper name,
21-
// which means our custom logic for <details/> is applied
2220
expect(inst.root.findByType(Icon).props.name).toEqual('triangle-right');
2321
});
2422

@@ -37,8 +35,6 @@ describe('<GithubHtmlView />', () => {
3735
<GithubHtmlView source={sourceHtml} onLinkPress={() => 0} />
3836
);
3937

40-
// we should be able to find the processed title text node,
41-
// which means our custom logic for <details/> is applied
4238
expect(
4339
!!inst.root
4440
.findAllByType(Text)
@@ -48,7 +44,7 @@ describe('<GithubHtmlView />', () => {
4844
).toBe(true);
4945
});
5046

51-
it('if there is no <summary/> tag, we should do fallback render', () => {
47+
it('if there is no <summary/> tag, we should do fallback render which contains no icon', () => {
5248
const sourceHtml = `
5349
<details>
5450
<div>no summary here!!</div>
@@ -59,7 +55,6 @@ describe('<GithubHtmlView />', () => {
5955
<GithubHtmlView source={sourceHtml} onLinkPress={() => 0} />
6056
);
6157

62-
// fallback render in this case won't contain any Icon
6358
expect(inst.root.findAllByType(Icon).length).toBe(0);
6459
});
6560

@@ -77,7 +72,6 @@ describe('<GithubHtmlView />', () => {
7772
<GithubHtmlView source={sourceHtml} onLinkPress={() => 0} />
7873
);
7974

80-
// should still reach here, and correct render the right arrow icon
8175
expect(inst.root.findByType(Icon).props.name).toEqual('triangle-right');
8276
});
8377
});

0 commit comments

Comments
 (0)