fix: fix and enable accessibilitySupportEnabled tests (#46825)

* test: do not skip visibleOnAllWorkspaces tests on Windows

That feature is supported on Linux, so move the test from the
"window states (excluding Linux)" section into the
"window states" section.

* fix: nested it() calls in visibleOnAllWorkspaces specs

* test: enable accessibilitySupportEnabled tests

test: check both getters after calling each setter

fix: do not assume the default initial value of accessibilitySupportEnabled

* chore: remove redundant test case

* chore: disable accessibilitySupportEnabled tests on Linux
This commit is contained in:
Charles Kerr 2025-04-28 23:52:26 -05:00 committed by GitHub
parent 4641bc9619
commit 2734088d20
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -979,22 +979,22 @@ describe('app module', () => {
});
ifdescribe(process.platform !== 'linux')('accessibilitySupportEnabled property', () => {
it('with properties', () => {
it('can set accessibility support enabled', () => {
expect(app.accessibilitySupportEnabled).to.eql(false);
app.accessibilitySupportEnabled = true;
expect(app.accessibilitySupportEnabled).to.eql(true);
});
});
describe('with functions', () => {
it('can set accessibility support enabled', () => {
expect(app.isAccessibilitySupportEnabled()).to.eql(false);
app.setAccessibilitySupportEnabled(true);
expect(app.isAccessibilitySupportEnabled()).to.eql(true);
});
it('is mutable', () => {
const values = [false, true, false];
const setters: Array<(arg: boolean) => void> = [
(value) => { app.accessibilitySupportEnabled = value; },
(value) => app.setAccessibilitySupportEnabled(value)
];
const getters: Array<() => boolean> = [
() => app.accessibilitySupportEnabled,
() => app.isAccessibilitySupportEnabled()
];
for (const value of values) {
for (const set of setters) {
set(value);
for (const get of getters) expect(get()).to.eql(value);
}
}
});
});