diff --git a/packages/plasma-b2c/src/components/Combobox/Combobox.component-test.tsx b/packages/plasma-b2c/src/components/Combobox/Combobox.component-test.tsx index 4526c09dc7..9ed69a0f27 100644 --- a/packages/plasma-b2c/src/components/Combobox/Combobox.component-test.tsx +++ b/packages/plasma-b2c/src/components/Combobox/Combobox.component-test.tsx @@ -8,6 +8,8 @@ const items = [ { value: 'north_america', label: 'Северная Америка', + className: 'test-classname', + 'data-name': 'test-data-name', }, { value: 'south_america', @@ -1167,6 +1169,22 @@ describe('plasma-b2c: Combobox', () => { cy.matchImageSnapshot(); }); + it('prop: item data-attrs', () => { + cy.viewport(400, 100); + + mount( +
+ +
, + ); + + cy.get('#single').realClick(); + cy.get('[id$="tree_level_1"]').should('be.visible'); + + cy.get('[id$="north_america"]').should('have.class', 'test-classname'); + cy.get('[id$="north_america"]').should('have.attr', 'data-name', 'test-data-name'); + }); + it('flow: single uncontrolled', () => { cy.viewport(1000, 500); diff --git a/packages/plasma-b2c/src/components/Dropdown/Dropdown.component-test.tsx b/packages/plasma-b2c/src/components/Dropdown/Dropdown.component-test.tsx index d2522e0b1a..b193615db0 100644 --- a/packages/plasma-b2c/src/components/Dropdown/Dropdown.component-test.tsx +++ b/packages/plasma-b2c/src/components/Dropdown/Dropdown.component-test.tsx @@ -13,6 +13,8 @@ const items = [ label: 'Северная Америка', contentLeft: , contentRight: , + className: 'test-classname', + 'data-name': 'test-data-name', }, { value: 'south_america', @@ -548,6 +550,24 @@ describe('plasma-b2c: Dropdown', () => { cy.matchImageSnapshot(); }); + it('prop: item data-attrs', () => { + cy.viewport(400, 100); + + mount( +
+ +
, + ); + + cy.get('button').realClick(); + cy.get('[id$="tree_level_1"]').should('be.visible'); + + cy.get('[id$="north_america"]').should('have.class', 'test-classname'); + cy.get('[id$="north_america"]').should('have.attr', 'data-name', 'test-data-name'); + }); + it('keyboard interactions', () => { cy.viewport(1000, 500); diff --git a/packages/plasma-b2c/src/components/Select/Select.component-test.tsx b/packages/plasma-b2c/src/components/Select/Select.component-test.tsx index a710a44815..e02a4513a9 100644 --- a/packages/plasma-b2c/src/components/Select/Select.component-test.tsx +++ b/packages/plasma-b2c/src/components/Select/Select.component-test.tsx @@ -11,6 +11,8 @@ const items = [ label: 'Северная Америка', contentLeft: , contentRight: , + className: 'test-classname', + 'data-name': 'test-data-name', }, { value: 'south_america', @@ -763,6 +765,22 @@ describe('plasma-b2c: Select', () => { cy.matchImageSnapshot(); }); + it('prop: item data-attrs', () => { + cy.viewport(400, 100); + + mount( +
+ +
, + ); + + cy.get('#single').realClick(); + cy.get('[id$="tree_level_1"]').should('be.visible'); + + cy.get('[id$="north_america"]').should('have.class', 'test-classname'); + cy.get('[id$="north_america"]').should('have.attr', 'data-name', 'test-data-name'); + }); + it('basic logic', () => { cy.viewport(1000, 500);