From 3d3c38982c67f2a3f7174428e35d150b9580a1cd Mon Sep 17 00:00:00 2001 From: Carlos Montenegro Date: Mon, 9 Sep 2024 11:35:37 -0300 Subject: [PATCH] LPD-35824 Implement unity test to check if data-option-reference attribute is rendered in Single Selection field type --- .../test/js/Radio/Radio.es.js | 43 +++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/test/js/Radio/Radio.es.js b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/test/js/Radio/Radio.es.js index 145681df89748c..293cbd12d2f71a 100644 --- a/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/test/js/Radio/Radio.es.js +++ b/modules/apps/dynamic-data-mapping/dynamic-data-mapping-form-field-type/test/js/Radio/Radio.es.js @@ -111,6 +111,49 @@ describe('Field Radio', () => { expect(container).toMatchSnapshot(); }); + it('renders option elements with data-option-reference attribute', () => { + const {container} = render( + + ); + + const radioInputElement1 = container.querySelector( + `input[value][type="radio"][data-option-reference="option1Reference"]` + ); + + const radioInputElement2 = container.querySelector( + `input[value][type="radio"][data-option-reference="option2Reference"]` + ); + + expect(radioInputElement1).toBeTruthy(); + expect(radioInputElement2).toBeTruthy(); + }); + it('renders no options when options is empty', () => { const {container} = render(