From 1cd0387d978c43cd6a75b91b27abec1653798af7 Mon Sep 17 00:00:00 2001 From: Samuel Susla Date: Mon, 2 Mar 2026 07:22:41 -0800 Subject: [PATCH] Add tests for aria- props (#55851) Summary: Pull Request resolved: https://github.com/facebook/react-native/pull/55851 Changelog: [Internal] just missing tests Reviewed By: javache Differential Revision: D94904120 fbshipit-source-id: fb73fc92e0ea30b3e37a1fd5725d3bec1b89fb1f --- .../Components/View/__tests__/View-itest.js | 125 ++++++++++++++++++ 1 file changed, 125 insertions(+) diff --git a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js index 306f3574322..e860b09779f 100644 --- a/packages/react-native/Libraries/Components/View/__tests__/View-itest.js +++ b/packages/react-native/Libraries/Components/View/__tests__/View-itest.js @@ -522,6 +522,115 @@ describe('', () => { ).toEqual(null); }); }); + describe('aria-label', () => { + it('is mapped to accessibilityLabel', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityLabel']}).toJSX(), + ).toEqual(); + }); + }); + + describe('aria-live', () => { + it('is mapped to accessibilityLiveRegion', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root + .getRenderedOutput({props: ['accessibilityLiveRegion']}) + .toJSX(), + ).toEqual(); + }); + }); + + describe('aria-busy', () => { + it('is mapped to accessibilityState', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityState']}).toJSX(), + ).toEqual( + , + ); + }); + }); + + describe('aria-disabled', () => { + it('is mapped to accessibilityState', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityState']}).toJSX(), + ).toEqual( + , + ); + }); + }); + + describe('aria-expanded', () => { + it('is mapped to accessibilityState', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityState']}).toJSX(), + ).toEqual( + , + ); + }); + }); + + describe('aria-selected', () => { + it('is mapped to accessibilityState', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityState']}).toJSX(), + ).toEqual( + , + ); + }); + }); + + describe('aria-checked', () => { + it('is mapped to accessibilityState', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect( + root.getRenderedOutput({props: ['accessibilityState']}).toJSX(), + ).toEqual( + , + ); + }); + }); }); describe('accessible', () => { @@ -547,6 +656,22 @@ describe('', () => { }); }); + describe('web compat props', () => { + describe('id', () => { + it('is mapped to nativeID', () => { + const root = Fantom.createRoot(); + + Fantom.runTask(() => { + root.render(); + }); + + expect(root.getRenderedOutput({props: ['nativeID']}).toJSX()).toEqual( + , + ); + }); + }); + }); + describe('ref', () => { it('is an element node', () => { const elementRef = createRef();