From 2734088d201199a5ede57463715729f517d394fc Mon Sep 17 00:00:00 2001 From: Charles Kerr Date: Mon, 28 Apr 2025 23:52:26 -0500 Subject: [PATCH] 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 --- spec/api-app-spec.ts | 32 ++++++++++++++++---------------- 1 file changed, 16 insertions(+), 16 deletions(-) diff --git a/spec/api-app-spec.ts b/spec/api-app-spec.ts index e3bb800e4558..1aa4daae04e0 100644 --- a/spec/api-app-spec.ts +++ b/spec/api-app-spec.ts @@ -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); + } + } }); });