Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
F
frontend
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
vicotor
frontend
Commits
10a208e2
Commit
10a208e2
authored
Jan 16, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
enable Web3 only for certain tests
parent
3b51fe06
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
10 deletions
+15
-10
TestApp.tsx
playwright/TestApp.tsx
+9
-4
ContractRead.pw.tsx
ui/address/contract/ContractRead.pw.tsx
+4
-4
ContractWrite.pw.tsx
ui/address/contract/ContractWrite.pw.tsx
+2
-2
No files found.
playwright/TestApp.tsx
View file @
10a208e2
...
@@ -36,6 +36,7 @@ const wagmiClient = createClient({
...
@@ -36,6 +36,7 @@ const wagmiClient = createClient({
type
Props
=
{
type
Props
=
{
children
:
React
.
ReactNode
;
children
:
React
.
ReactNode
;
withSocket
?:
boolean
;
withSocket
?:
boolean
;
withWeb3
?:
boolean
;
appContext
?:
{
appContext
?:
{
pageProps
:
PageProps
;
pageProps
:
PageProps
;
};
};
...
@@ -48,7 +49,7 @@ const defaultAppContext = {
...
@@ -48,7 +49,7 @@ const defaultAppContext = {
},
},
};
};
const
TestApp
=
({
children
,
withSocket
,
appContext
=
defaultAppContext
}:
Props
)
=>
{
const
TestApp
=
({
children
,
withSocket
,
withWeb3
,
appContext
=
defaultAppContext
}:
Props
)
=>
{
const
[
queryClient
]
=
React
.
useState
(()
=>
new
QueryClient
({
const
[
queryClient
]
=
React
.
useState
(()
=>
new
QueryClient
({
defaultOptions
:
{
defaultOptions
:
{
queries
:
{
queries
:
{
...
@@ -58,14 +59,18 @@ const TestApp = ({ children, withSocket, appContext = defaultAppContext }: Props
...
@@ -58,14 +59,18 @@ const TestApp = ({ children, withSocket, appContext = defaultAppContext }: Props
},
},
}));
}));
const
content
=
withWeb3
?
(
<
WagmiConfig
client=
{
wagmiClient
}
>
{
children
}
</
WagmiConfig
>
)
:
children
;
return
(
return
(
<
ChakraProvider
theme=
{
theme
}
>
<
ChakraProvider
theme=
{
theme
}
>
<
QueryClientProvider
client=
{
queryClient
}
>
<
QueryClientProvider
client=
{
queryClient
}
>
<
SocketProvider
url=
{
withSocket
?
`ws://localhost:${ PORT }`
:
undefined
}
>
<
SocketProvider
url=
{
withSocket
?
`ws://localhost:${ PORT }`
:
undefined
}
>
<
AppContextProvider
{
...
appContext
}
>
<
AppContextProvider
{
...
appContext
}
>
<
WagmiConfig
client=
{
wagmiClient
}
>
{
content
}
{
children
}
</
WagmiConfig
>
</
AppContextProvider
>
</
AppContextProvider
>
</
SocketProvider
>
</
SocketProvider
>
</
QueryClientProvider
>
</
QueryClientProvider
>
...
...
ui/address/contract/ContractRead.pw.tsx
View file @
10a208e2
...
@@ -16,7 +16,7 @@ const hooksConfig = {
...
@@ -16,7 +16,7 @@ const hooksConfig = {
},
},
};
};
test
.
skip
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
contractMethodsMock
.
read
),
body
:
JSON
.
stringify
(
contractMethodsMock
.
read
),
...
@@ -27,7 +27,7 @@ test.skip('base view +@mobile +@dark-mode', async({ mount, page }) => {
...
@@ -27,7 +27,7 @@ test.skip('base view +@mobile +@dark-mode', async({ mount, page }) => {
}));
}));
const
component
=
await
mount
(
const
component
=
await
mount
(
<
TestApp
>
<
TestApp
withWeb3
>
<
ContractRead
/>
<
ContractRead
/>
</
TestApp
>,
</
TestApp
>,
{
hooksConfig
},
{
hooksConfig
},
...
@@ -45,7 +45,7 @@ test.skip('base view +@mobile +@dark-mode', async({ mount, page }) => {
...
@@ -45,7 +45,7 @@ test.skip('base view +@mobile +@dark-mode', async({ mount, page }) => {
await
expect
(
component
).
toHaveScreenshot
();
await
expect
(
component
).
toHaveScreenshot
();
});
});
test
.
skip
(
'
error result
'
,
async
({
mount
,
page
})
=>
{
test
(
'
error result
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
contractMethodsMock
.
read
),
body
:
JSON
.
stringify
(
contractMethodsMock
.
read
),
...
@@ -56,7 +56,7 @@ test.skip('error result', async({ mount, page }) => {
...
@@ -56,7 +56,7 @@ test.skip('error result', async({ mount, page }) => {
}));
}));
const
component
=
await
mount
(
const
component
=
await
mount
(
<
TestApp
>
<
TestApp
withWeb3
>
<
ContractRead
/>
<
ContractRead
/>
</
TestApp
>,
</
TestApp
>,
{
hooksConfig
},
{
hooksConfig
},
...
...
ui/address/contract/ContractWrite.pw.tsx
View file @
10a208e2
...
@@ -15,14 +15,14 @@ const hooksConfig = {
...
@@ -15,14 +15,14 @@ const hooksConfig = {
},
},
};
};
test
.
skip
(
'
base view +@mobile
'
,
async
({
mount
,
page
})
=>
{
test
(
'
base view +@mobile
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
CONTRACT_READ_METHODS_API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
status
:
200
,
body
:
JSON
.
stringify
(
contractMethodsMock
.
write
),
body
:
JSON
.
stringify
(
contractMethodsMock
.
write
),
}));
}));
const
component
=
await
mount
(
const
component
=
await
mount
(
<
TestApp
>
<
TestApp
withWeb3
>
<
ContractWrite
/>
<
ContractWrite
/>
</
TestApp
>,
</
TestApp
>,
{
hooksConfig
},
{
hooksConfig
},
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment