@@ -21,6 +21,7 @@ import { rest } from "msw"
2121import { Region } from "api/typesGenerated"
2222import "testHelpers/localstorage"
2323import userEvent from "@testing-library/user-event"
24+ import UserEvent from "@testing-library/user-event"
2425
2526// Mock useProxyLatency to use a hard-coded latency. 'jest.mock' must be called
2627// here and not inside a unit test.
@@ -176,7 +177,7 @@ interface ProxyContextSelectionTest {
176177latencies ?:Record < string , ProxyLatency . ProxyLatencyReport >
177178// afterLoad are actions to take after loading the component, but before
178179// assertions. This is useful for simulating user actions.
179- afterLoad ?:( user : typeof userEvent ) => Promise < void >
180+ afterLoad ?:( ) => Promise < void >
180181
181182// Assert these values.
182183// expProxyID is the proxyID returned to be used.
@@ -192,15 +193,15 @@ describe("ProxyContextSelection", () => {
192193} )
193194
194195// A way to simulate a user clearing the proxy selection.
195- const clearProxyAction = async ( user :typeof userEvent ) :Promise < void > => {
196+ const clearProxyAction = async ( ) :Promise < void > => {
197+ const user = userEvent . setup ( )
196198const clearProxyButton = screen . getByTestId ( "clearProxy" )
197199await user . click ( clearProxyButton )
198200}
199201
200- const userSelectProxy = (
201- proxy :Region ,
202- ) :( ( user :typeof userEvent ) => Promise < void > ) => {
203- return async ( user ) :Promise < void > => {
202+ const userSelectProxy = ( proxy :Region ) :( ( ) => Promise < void > ) => {
203+ return async ( ) :Promise < void > => {
204+ const user = userEvent . setup ( )
204205const selectData = screen . getByTestId ( "userSelectProxyData" )
205206selectData . innerText = JSON . stringify ( proxy )
206207
@@ -366,9 +367,8 @@ describe("ProxyContextSelection", () => {
366367TestingComponent ( )
367368await waitForLoaderToBeRemoved ( )
368369
369- const user = userEvent . setup ( )
370370if ( afterLoad ) {
371- await afterLoad ( user )
371+ await afterLoad ( )
372372}
373373
374374await screen . findByTestId ( "isFetched" ) . then ( ( x ) => {