@@ -10,6 +10,7 @@ import { DEFAULT_ATTR, NULL_CELL_CODE, NULL_CELL_WIDTH, NULL_CELL_CHAR } from '.
1010import { FLAGS } from '../Types' ;
1111import { BufferLine } from '../../BufferLine' ;
1212import { IBufferLine } from '../../Types' ;
13+ import { DEFAULT_COLOR } from '../atlas/Types' ;
1314
1415describe ( 'DomRendererRowFactory' , ( ) => {
1516 let dom : jsdom . JSDOM ;
@@ -76,7 +77,7 @@ describe('DomRendererRowFactory', () => {
7677 } ) ;
7778
7879 it ( 'should add classes for 256 foreground colors' , ( ) => {
79- const defaultAttrNoFgColor = ( 0 << 9 ) | ( 256 << 0 ) ;
80+ const defaultAttrNoFgColor = ( 0 << 9 ) | ( DEFAULT_COLOR << 0 ) ;
8081 for ( let i = 0 ; i < 256 ; i ++ ) {
8182 lineData . set ( 0 , [ defaultAttrNoFgColor | ( i << 9 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
8283 const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
@@ -87,7 +88,7 @@ describe('DomRendererRowFactory', () => {
8788 } ) ;
8889
8990 it ( 'should add classes for 256 background colors' , ( ) => {
90- const defaultAttrNoBgColor = ( 257 << 9 ) | ( 0 << 0 ) ;
91+ const defaultAttrNoBgColor = ( DEFAULT_ATTR << 9 ) | ( 0 << 0 ) ;
9192 for ( let i = 0 ; i < 256 ; i ++ ) {
9293 lineData . set ( 0 , [ defaultAttrNoBgColor | ( i << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
9394 const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
@@ -106,24 +107,24 @@ describe('DomRendererRowFactory', () => {
106107 } ) ;
107108
108109 it ( 'should correctly invert default fg color' , ( ) => {
109- lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 257 << 9 ) | ( 1 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
110+ lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( DEFAULT_ATTR << 9 ) | ( 1 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
110111 const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
111112 assert . equal ( getFragmentHtml ( fragment ) ,
112- '<span class="xterm-fg-1 xterm-bg-15 ">a</span>'
113+ '<span class="xterm-fg-1 xterm-bg-257 ">a</span>'
113114 ) ;
114115 } ) ;
115116
116117 it ( 'should correctly invert default bg color' , ( ) => {
117- lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 1 << 9 ) | ( 256 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
118+ lineData . set ( 0 , [ ( FLAGS . INVERSE << 18 ) | ( 1 << 9 ) | ( DEFAULT_COLOR << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
118119 const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
119120 assert . equal ( getFragmentHtml ( fragment ) ,
120- '<span class="xterm-fg-0 xterm-bg-1">a</span>'
121+ '<span class="xterm-fg-257 xterm-bg-1">a</span>'
121122 ) ;
122123 } ) ;
123124
124125 it ( 'should turn bold fg text bright' , ( ) => {
125126 for ( let i = 0 ; i < 8 ; i ++ ) {
126- lineData . set ( 0 , [ ( FLAGS . BOLD << 18 ) | ( i << 9 ) | ( 256 << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
127+ lineData . set ( 0 , [ ( FLAGS . BOLD << 18 ) | ( i << 9 ) | ( DEFAULT_COLOR << 0 ) , 'a' , 1 , 'a' . charCodeAt ( 0 ) ] ) ;
127128 const fragment = rowFactory . createRow ( lineData , false , undefined , 0 , 5 , 20 ) ;
128129 assert . equal ( getFragmentHtml ( fragment ) ,
129130 `<span class="xterm-bold xterm-fg-${ i + 8 } ">a</span>`
0 commit comments