Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc739f24

Browse files
committed
Move arg inside the funcs
1 parentd1c9f3f commitc739f24

File tree

1 file changed

+8
-8
lines changed

1 file changed

+8
-8
lines changed

‎site/src/contexts/ProxyContext.test.tsx‎

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import { rest } from "msw"
2121
import{Region}from"api/typesGenerated"
2222
import"testHelpers/localstorage"
2323
importuserEventfrom"@testing-library/user-event"
24+
importUserEventfrom"@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 {
176177
latencies?: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:typeofuserEvent)=>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-
constclearProxyAction=async(user:typeofuserEvent):Promise<void>=>{
196+
constclearProxyAction=async():Promise<void>=>{
197+
constuser=userEvent.setup()
196198
constclearProxyButton=screen.getByTestId("clearProxy")
197199
awaituser.click(clearProxyButton)
198200
}
199201

200-
constuserSelectProxy=(
201-
proxy:Region,
202-
):((user:typeofuserEvent)=>Promise<void>)=>{
203-
returnasync(user):Promise<void>=>{
202+
constuserSelectProxy=(proxy:Region):(()=>Promise<void>)=>{
203+
returnasync():Promise<void>=>{
204+
constuser=userEvent.setup()
204205
constselectData=screen.getByTestId("userSelectProxyData")
205206
selectData.innerText=JSON.stringify(proxy)
206207

@@ -366,9 +367,8 @@ describe("ProxyContextSelection", () => {
366367
TestingComponent()
367368
awaitwaitForLoaderToBeRemoved()
368369

369-
constuser=userEvent.setup()
370370
if(afterLoad){
371-
awaitafterLoad(user)
371+
awaitafterLoad()
372372
}
373373

374374
awaitscreen.findByTestId("isFetched").then((x)=>{

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp