From dacacceb04a7a7134533f8ce2b7769eb17113f81 Mon Sep 17 00:00:00 2001 From: Sebastian Silbermann Date: Thu, 28 Nov 2019 16:20:15 +0100 Subject: [PATCH] More accessible name tests --- packages/material-ui/src/TextField/TextField.test.js | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/packages/material-ui/src/TextField/TextField.test.js b/packages/material-ui/src/TextField/TextField.test.js index fa47f18bacf7da..ddb2ea49d90989 100644 --- a/packages/material-ui/src/TextField/TextField.test.js +++ b/packages/material-ui/src/TextField/TextField.test.js @@ -160,14 +160,7 @@ describe('', () => { , ); - const label = getByRole('button') - .getAttribute('aria-labelledby') - .split(' ') - .map(idref => document.getElementById(idref)) - .reduce((partial, element) => `${partial} ${element.textContent}`, ''); - // this whitespace is ok since actual AT will only use so called "flat strings" - // https://w3c.github.io/accname/#mapping_additional_nd_te - expect(label).to.equal(' Release: Stable'); + expect(getByRole('button')).to.have.accessibleName('Release: Stable'); }); it('creates an input[hidden] that has no accessible properties', () => {