feat: enable resetting accent color (#48853)

This commit is contained in:
Shelley Vohr 2025-11-10 22:45:40 +01:00 committed by GitHub
commit 3e77a1a359
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
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', () => {