From 7e03fba6cd4256ce244e895827070b08556d740b Mon Sep 17 00:00:00 2001 From: Simon Hornby Date: Fri, 28 Oct 2022 14:47:44 +0200 Subject: [PATCH] make prettify large number tests independent of locale (#2284) --- .../common/PrettifyLargeNumber/PrettifyLargeNumber.test.tsx | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/frontend/src/component/common/PrettifyLargeNumber/PrettifyLargeNumber.test.tsx b/frontend/src/component/common/PrettifyLargeNumber/PrettifyLargeNumber.test.tsx index 1b845b519e..855ece4d16 100644 --- a/frontend/src/component/common/PrettifyLargeNumber/PrettifyLargeNumber.test.tsx +++ b/frontend/src/component/common/PrettifyLargeNumber/PrettifyLargeNumber.test.tsx @@ -11,7 +11,7 @@ describe('PrettifyLargeNumber', () => { LARGE_NUMBER_PRETTIFIED ); - expect(prettifiedText.textContent).toBe('999,999'); + expect(prettifiedText.textContent).toHaveLength('999,999'.length); }); it('should render prettified number for value equal to the threshold', async () => { @@ -41,7 +41,9 @@ describe('PrettifyLargeNumber', () => { LARGE_NUMBER_PRETTIFIED ); - expect(prettifiedText.getAttribute('aria-label')).toBe('12,345,678'); + expect(prettifiedText.getAttribute('aria-label')).toHaveLength( + '12,345,678'.length + ); }); it('should render prettified number with provided significant figures for value greater than threshold', async () => {