From: Kevin Silva Date: Tue, 21 Feb 2023 11:01:13 +0000 (+0100) Subject: [NO-JIRA] fix DateTimeFormatter to accept different locales X-Git-Tag: 10.0.0.68432~213 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=5b145a8bcdef364a069ea20b453cd7dba52c36e8;p=sonarqube.git [NO-JIRA] fix DateTimeFormatter to accept different locales --- diff --git a/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx b/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx index 7caddd1f23e..aebe6b1a3a4 100644 --- a/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx +++ b/server/sonar-web/src/main/js/components/intl/__tests__/DateTimeFormatter-test.tsx @@ -24,10 +24,10 @@ import DateTimeFormatter from '../DateTimeFormatter'; it('should render correctly', () => { renderDateTimeFormatter(); - expect(screen.getByText('February 20, 2020, 8:20 PM')).toBeInTheDocument(); + expect(screen.getByText(/February 20, 2020(\sat|,) 8:20 PM/)).toBeInTheDocument(); renderDateTimeFormatter((formatted: string) => Nice date: {formatted}); - expect(screen.getByText('Nice date: February 20, 2020, 8:20 PM')).toBeInTheDocument(); + expect(screen.getByText(/Nice date: February 20, 2020(\sat|,) 8:20 PM/)).toBeInTheDocument(); }); function renderDateTimeFormatter(children?: (d: string) => React.ReactNode) {