feat: enable resetting accent color (#48852)

This commit is contained in:
Shelley Vohr
2025-11-10 22:44:20 +01:00
committed by GitHub
parent 215128715a
commit 331f8cca47
4 changed files with 42 additions and 13 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', () => {