Skip to content

Commit 478e696

Browse files
committed
Add regression test for double outline
Reported in mui#26493 (comment)
1 parent 41aae13 commit 478e696

File tree

2 files changed

+23
-0
lines changed

2 files changed

+23
-0
lines changed
Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import * as React from 'react';
2+
import Rating from '@material-ui/core/Rating';
3+
4+
export default function FocusVisibleRating() {
5+
return <Rating name="no-value-precise" precision={0.5} value={null} />;
6+
}

test/regressions/index.test.js

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -99,6 +99,23 @@ async function main() {
9999
await takeScreenshot({ testcase, route: '/regression-Rating/FocusVisibleRating2' });
100100
await page.keyboard.press('ArrowLeft');
101101
await takeScreenshot({ testcase, route: '/regression-Rating/FocusVisibleRating3' });
102+
await page.keyboard.press('Tab');
103+
await takeScreenshot({ testcase, route: '/regression-Rating/FocusVisibleRating4' });
104+
await page.keyboard.press('ArrowRight');
105+
await takeScreenshot({ testcase, route: '/regression-Rating/FocusVisibleRating3' });
106+
await page.keyboard.press('ArrowLeft');
107+
await takeScreenshot({ testcase, route: '/regression-Rating/FocusVisibleRating3' });
108+
});
109+
110+
it('should handle focus-visible with precise ratings correctly', async () => {
111+
const index = routes.findIndex(
112+
(route) => route === '/regression-Rating/PreciseFocusVisibleRating',
113+
);
114+
const testcase = await renderFixture(index);
115+
await page.keyboard.press('Tab');
116+
await takeScreenshot({ testcase, route: '/regression-Rating/PreciseFocusVisibleRating2' });
117+
await page.keyboard.press('ArrowRight');
118+
await takeScreenshot({ testcase, route: '/regression-Rating/PreciseFocusVisibleRating3' });
102119
});
103120
});
104121

0 commit comments

Comments
 (0)