feat: enable resetting accent color (#48274)

This commit is contained in:
Shelley Vohr
2025-10-21 16:49:08 +02:00
committed by GitHub
parent 6562d6ed0b
commit 0a19176917
4 changed files with 43 additions and 12 deletions

View File

@@ -2562,7 +2562,23 @@ describe('BrowserWindow module', () => {
expect(() => {
// @ts-ignore this is wrong on purpose.
w.setAccentColor([1, 2, 3]);
}).to.throw('Invalid accent color value - must be a string or boolean');
}).to.throw('Invalid accent color value - must be null, hex string, or boolean');
});
it('throws if called with an invalid parameter', () => {
const w = new BrowserWindow({ show: false });
expect(() => {
// @ts-ignore this is wrong on purpose.
w.setAccentColor(new Date());
}).to.throw('Invalid accent color value - must be null, hex string, or boolean');
});
it('can be reset with null', () => {
const w = new BrowserWindow({ show: false });
w.setAccentColor('#FF0000');
expect(w.getAccentColor()).to.equal('#FF0000');
w.setAccentColor(null);
expect(w.getAccentColor()).to.not.equal('#FF0000');
});
it('returns the accent color after setting it to a string', () => {