mirror of
https://github.com/electron/electron.git
synced 2026-01-09 15:38:08 -05:00
feat: Add getAccentColor on Linux (#48027)
* feat: Implement `getAccentColor` on Linux * doc: Update OS support for accent color APIs
This commit is contained in:
@@ -2,11 +2,17 @@ import { systemPreferences } from 'electron/main';
|
||||
|
||||
import { expect } from 'chai';
|
||||
|
||||
import { ifdescribe } from './lib/spec-helpers';
|
||||
import { ifdescribe, ifit } from './lib/spec-helpers';
|
||||
|
||||
describe('systemPreferences module', () => {
|
||||
ifdescribe(process.platform === 'win32')('systemPreferences.getAccentColor', () => {
|
||||
it('should return a non-empty string', () => {
|
||||
ifdescribe(['win32', 'linux'].includes(process.platform))('systemPreferences.getAccentColor', () => {
|
||||
ifit(process.platform === 'linux')('should return a string', () => {
|
||||
// Testing this properly (i.e. non-empty string) requires
|
||||
// some tricky D-Bus mock setup.
|
||||
const accentColor = systemPreferences.getAccentColor();
|
||||
expect(accentColor).to.be.a('string');
|
||||
});
|
||||
ifit(process.platform === 'win32')('should return a non-empty string', () => {
|
||||
const accentColor = systemPreferences.getAccentColor();
|
||||
expect(accentColor).to.be.a('string').that.is.not.empty('accent color');
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user