From 64a430a16f3acbf1b28d6d2b964a3b486520ed97 Mon Sep 17 00:00:00 2001 From: Zach Shilton <4624598+zchsh@users.noreply.github.com> Date: Fri, 26 Jul 2024 15:20:03 -0400 Subject: [PATCH] add test error to footer --- src/components/footer/index.tsx | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) diff --git a/src/components/footer/index.tsx b/src/components/footer/index.tsx index 9453b8bd31..2c3abf6ed7 100644 --- a/src/components/footer/index.tsx +++ b/src/components/footer/index.tsx @@ -3,7 +3,7 @@ * SPDX-License-Identifier: MPL-2.0 */ -import React, { ReactElement } from 'react' +import React, { ReactElement, useEffect } from 'react' import { useRouter } from 'next/router' import classNames from 'classnames' import { IconExternalLink16 } from '@hashicorp/flight-icons/svg-react/external-link-16' @@ -70,13 +70,21 @@ const FOOTER_ITEMS: FooterItem[] = [ }, ] -function Footer({ - openConsentManager, - className, -}: FooterProps): React.ReactElement { +function Footer({ openConsentManager, className }: FooterProps): ReactElement { const { pathname } = useRouter() const shouldRenderThemeSwitcher = isThemedPath(pathname) + /** + * TODO: this is an error used to test source maps. + * It should be removed before source maps work ends up on main. + */ + useEffect(() => { + const timer = setTimeout(() => { + throw new Error('This is a test error thrown after 3 seconds') + }, 3000) + return () => clearTimeout(timer) // Cleanup the timer on component unmount + }, []) + return (