diff --git a/src/browser/renderer/dom/DomRendererRowFactory.test.ts b/src/browser/renderer/dom/DomRendererRowFactory.test.ts
index 5a374b14..7c48cce8 100644
--- a/src/browser/renderer/dom/DomRendererRowFactory.test.ts
+++ b/src/browser/renderer/dom/DomRendererRowFactory.test.ts
@@ -12,7 +12,7 @@ import { IBufferLine } from 'common/Types';
import { CellData } from 'common/buffer/CellData';
import { MockCoreService, MockDecorationService, MockOptionsService } from 'common/TestUtils.test';
import { css } from 'common/Color';
-import { MockCharacterJoinerService, MockSelectionService } from 'browser/TestUtils.test';
+import { MockCharacterJoinerService } from 'browser/TestUtils.test';
describe('DomRendererRowFactory', () => {
let dom: jsdom.JSDOM;
@@ -245,6 +245,26 @@ describe('DomRendererRowFactory', () => {
);
});
});
+
+ describe('selectionForeground', () => {
+ it('should force selected cells with content to be rendered above the background', () => {
+ lineData.setCell(0, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
+ lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'b', 1, 'b'.charCodeAt(0)]));
+ rowFactory.onSelectionChanged([1, 0], [2, 0], false);
+ const fragment = rowFactory.createRow(lineData, 0, false, undefined, 0, false, 5, 20);
+ assert.equal(getFragmentHtml(fragment),
+ 'ab'
+ );
+ });
+ it('should force whitespace cells to be rendered above the background', () => {
+ lineData.setCell(1, CellData.fromCharData([DEFAULT_ATTR, 'a', 1, 'a'.charCodeAt(0)]));
+ rowFactory.onSelectionChanged([0, 0], [2, 0], false);
+ const fragment = rowFactory.createRow(lineData, 0, false, undefined, 0, false, 5, 20);
+ assert.equal(getFragmentHtml(fragment),
+ ' a'
+ );
+ });
+ });
});
function getFragmentHtml(fragment: DocumentFragment): string {