@@ -5,7 +5,7 @@ import { GithubHtmlView } from 'components';
5
5
import { Icon } from 'react-native-elements' ;
6
6
7
7
describe ( '<GithubHtmlView />' , ( ) => {
8
- it ( 'correctly renders <details/> tag in GithubHtmlView' , ( ) => {
8
+ it ( 'correctly renders <details/> tag in GithubHtmlView with correct icon ' , ( ) => {
9
9
const sourceHtml = `
10
10
<details>
11
11
<summary>title</summary>
@@ -17,8 +17,6 @@ describe('<GithubHtmlView />', () => {
17
17
< GithubHtmlView source = { sourceHtml } onLinkPress = { ( ) => 0 } />
18
18
) ;
19
19
20
- // we should be able to find a <Icon/> with proper name,
21
- // which means our custom logic for <details/> is applied
22
20
expect ( inst . root . findByType ( Icon ) . props . name ) . toEqual ( 'triangle-right' ) ;
23
21
} ) ;
24
22
@@ -37,8 +35,6 @@ describe('<GithubHtmlView />', () => {
37
35
< GithubHtmlView source = { sourceHtml } onLinkPress = { ( ) => 0 } />
38
36
) ;
39
37
40
- // we should be able to find the processed title text node,
41
- // which means our custom logic for <details/> is applied
42
38
expect (
43
39
! ! inst . root
44
40
. findAllByType ( Text )
@@ -48,7 +44,7 @@ describe('<GithubHtmlView />', () => {
48
44
) . toBe ( true ) ;
49
45
} ) ;
50
46
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 ' , ( ) => {
52
48
const sourceHtml = `
53
49
<details>
54
50
<div>no summary here!!</div>
@@ -59,7 +55,6 @@ describe('<GithubHtmlView />', () => {
59
55
< GithubHtmlView source = { sourceHtml } onLinkPress = { ( ) => 0 } />
60
56
) ;
61
57
62
- // fallback render in this case won't contain any Icon
63
58
expect ( inst . root . findAllByType ( Icon ) . length ) . toBe ( 0 ) ;
64
59
} ) ;
65
60
@@ -77,7 +72,6 @@ describe('<GithubHtmlView />', () => {
77
72
< GithubHtmlView source = { sourceHtml } onLinkPress = { ( ) => 0 } />
78
73
) ;
79
74
80
- // should still reach here, and correct render the right arrow icon
81
75
expect ( inst . root . findByType ( Icon ) . props . name ) . toEqual ( 'triangle-right' ) ;
82
76
} ) ;
83
77
} ) ;
0 commit comments