Allow unsetting extending ansicolors

This commit is contained in:
Simon Lamon
2022-07-19 17:22:54 +00:00
parent 2a0681f0c0
commit 06627cb0bb
2 changed files with 22 additions and 1 deletions
+21 -1
View File
@@ -320,7 +320,7 @@ describe('ColorManager', () => {
}
});
it('should set one extended ansi colors and keep the other default', () => {
it('should set one extended ansi color and keep the other default', () => {
cm.setTheme({
extendedAnsi: ['#ffffff']
});
@@ -328,5 +328,25 @@ describe('ColorManager', () => {
assert.equal(cm.colors.ansi[16].css, '#ffffff');
assert.equal(cm.colors.ansi[17].css, DEFAULT_ANSI_COLORS[17].css);
});
it('should set extended ansi colors to the default after setting to something', () => {
cm.setTheme({
extendedAnsi: ['#ffffff']
});
assert.equal(cm.colors.ansi[16].css, '#ffffff');
cm.setTheme({
extendedAnsi: []
});
assert.equal(cm.colors.ansi[16].css, DEFAULT_ANSI_COLORS[16].css);
cm.setTheme({
extendedAnsi: ['#ffffff']
});
assert.equal(cm.colors.ansi[16].css, '#ffffff');
cm.setTheme({});
assert.equal(cm.colors.ansi[16].css, DEFAULT_ANSI_COLORS[16].css);
});
});
});