@@ -23,11 +23,10 @@ describe('DomRendererRowFactory', () => {
23
23
} ) ;
24
24
25
25
describe ( 'createRow' , ( ) => {
26
- it ( 'should create an element for every character in the row' , ( ) => {
26
+ it ( 'should not create anything for an empty row' , ( ) => {
27
27
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
28
28
assert . equal ( getFragmentHtml ( fragment ) ,
29
- '<span> </span>' +
30
- '<span> </span>'
29
+ ''
31
30
) ;
32
31
} ) ;
33
32
@@ -45,8 +44,7 @@ describe('DomRendererRowFactory', () => {
45
44
for ( const style of [ 'block' , 'bar' , 'underline' ] ) {
46
45
const fragment = rowFactory . createRow ( lineData , true , style , 0 , 5 , 20 ) ;
47
46
assert . equal ( getFragmentHtml ( fragment ) ,
48
- `<span class="xterm-cursor xterm-cursor-${ style } "> </span>` +
49
- '<span> </span>'
47
+ `<span class="xterm-cursor xterm-cursor-${ style } "> </span>`
50
48
) ;
51
49
}
52
50
} ) ;
@@ -65,17 +63,15 @@ describe('DomRendererRowFactory', () => {
65
63
lineData . set ( 0 , [ DEFAULT_ATTR | ( FLAGS . BOLD << 18 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
66
64
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
67
65
assert . equal ( getFragmentHtml ( fragment ) ,
68
- '<span class="xterm-bold">a</span>' +
69
- '<span> </span>'
66
+ '<span class="xterm-bold">a</span>'
70
67
) ;
71
68
} ) ;
72
69
73
70
it ( 'should add class for italic' , ( ) => {
74
71
lineData . set ( 0 , [ DEFAULT_ATTR | ( FLAGS . ITALIC << 18 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
75
72
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
76
73
assert . equal ( getFragmentHtml ( fragment ) ,
77
- '<span class="xterm-italic">a</span>' +
78
- '<span> </span>'
74
+ '<span class="xterm-italic">a</span>'
79
75
) ;
80
76
} ) ;
81
77
@@ -85,8 +81,7 @@ describe('DomRendererRowFactory', () => {
85
81
lineData . set ( 0 , [ defaultAttrNoFgColor | ( i << 9 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
86
82
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
87
83
assert . equal ( getFragmentHtml ( fragment ) ,
88
- `<span class="xterm-fg-${ i } ">a</span>` +
89
- '<span> </span>'
84
+ `<span class="xterm-fg-${ i } ">a</span>`
90
85
) ;
91
86
}
92
87
} ) ;
@@ -97,8 +92,7 @@ describe('DomRendererRowFactory', () => {
97
92
lineData . set ( 0 , [ defaultAttrNoBgColor | ( i << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
98
93
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
99
94
assert . equal ( getFragmentHtml ( fragment ) ,
100
- `<span class="xterm-bg-${ i } ">a</span>` +
101
- '<span> </span>'
95
+ `<span class="xterm-bg-${ i } ">a</span>`
102
96
) ;
103
97
}
104
98
} ) ;
@@ -107,26 +101,23 @@ describe('DomRendererRowFactory', () => {
107
101
lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 2 << 9 ) | ( 1 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
108
102
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
109
103
assert . equal ( getFragmentHtml ( fragment ) ,
110
- '<span class="xterm-fg-1 xterm-bg-2">a</span>' +
111
- '<span> </span>'
104
+ '<span class="xterm-fg-1 xterm-bg-2">a</span>'
112
105
) ;
113
106
} ) ;
114
107
115
108
it ( 'should correctly invert default fg color' , ( ) => {
116
109
lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 257 << 9 ) | ( 1 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
117
110
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
118
111
assert . equal ( getFragmentHtml ( fragment ) ,
119
- '<span class="xterm-fg-1 xterm-bg-15">a</span>' +
120
- '<span> </span>'
112
+ '<span class="xterm-fg-1 xterm-bg-15">a</span>'
121
113
) ;
122
114
} ) ;
123
115
124
116
it ( 'should correctly invert default bg color' , ( ) => {
125
117
lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 1 << 9 ) | ( 256 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
126
118
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
127
119
assert . equal ( getFragmentHtml ( fragment ) ,
128
- '<span class="xterm-fg-0 xterm-bg-1">a</span>' +
129
- '<span> </span>'
120
+ '<span class="xterm-fg-0 xterm-bg-1">a</span>'
130
121
) ;
131
122
} ) ;
132
123
@@ -135,8 +126,7 @@ describe('DomRendererRowFactory', () => {
135
126
lineData . set ( 0 , [ ( FLAGS . BOLD << 18 ) | ( i << 9 ) | ( 256 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
136
127
const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
137
128
assert . equal ( getFragmentHtml ( fragment ) ,
138
- `<span class="xterm-bold xterm-fg-${ i + 8 } ">a</span>` +
139
- '<span> </span>'
129
+ `<span class="xterm-bold xterm-fg-${ i + 8 } ">a</span>`
140
130
) ;
141
131
}
142
132
} ) ;
0 commit comments