fix: fix and enable accessibilitySupportEnabled tests (36-x-y) (#47196)

fix: fix and enable `accessibilitySupportEnabled` tests (#46825)

* 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-05-23 10:15:57 -05:00 committed by GitHub
commit 1c132a3fdb
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', () => { ifdescribe(process.platform !== 'linux')('accessibilitySupportEnabled property', () => {
it('with properties', () => { it('is mutable', () => {
it('can set accessibility support enabled', () => { const values = [false, true, false];
expect(app.accessibilitySupportEnabled).to.eql(false); const setters: Array<(arg: boolean) => void> = [
(value) => { app.accessibilitySupportEnabled = value; },
app.accessibilitySupportEnabled = true; (value) => app.setAccessibilitySupportEnabled(value)
expect(app.accessibilitySupportEnabled).to.eql(true); ];
}); const getters: Array<() => boolean> = [
}); () => app.accessibilitySupportEnabled,
() => app.isAccessibilitySupportEnabled()
describe('with functions', () => { ];
it('can set accessibility support enabled', () => { for (const value of values) {
expect(app.isAccessibilitySupportEnabled()).to.eql(false); for (const set of setters) {
set(value);
app.setAccessibilitySupportEnabled(true); for (const get of getters) expect(get()).to.eql(value);
expect(app.isAccessibilitySupportEnabled()).to.eql(true); }
}); }
}); });
}); });