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
db115fe7
Commit
db115fe7
authored
Oct 14, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[skip ci] clean up and more tests
parent
a3f9cc19
Changes
6
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
12 deletions
+23
-12
marketplace.tsx
lib/contexts/marketplace.tsx
+1
-1
fetchProxy.ts
nextjs/utils/fetchProxy.ts
+2
-2
TestApp.tsx
playwright/TestApp.tsx
+18
-6
AuthModalScreenOtpCode.tsx
ui/snippets/auth/screens/AuthModalScreenOtpCode.tsx
+0
-1
UserProfileDesktop.pw.tsx
ui/snippets/user/profile/UserProfileDesktop.pw.tsx
+2
-2
UserProfileDesktop.pw.tsx_default_without-address-1.png
..._/UserProfileDesktop.pw.tsx_default_without-address-1.png
+0
-0
No files found.
lib/contexts/marketplace.tsx
View file @
db115fe7
...
...
@@ -10,7 +10,7 @@ type TMarketplaceContext = {
setIsAutoConnectDisabled
:
(
isAutoConnectDisabled
:
boolean
)
=>
void
;
}
const
MarketplaceContext
=
createContext
<
TMarketplaceContext
>
({
export
const
MarketplaceContext
=
createContext
<
TMarketplaceContext
>
({
isAutoConnectDisabled
:
false
,
setIsAutoConnectDisabled
:
()
=>
{},
});
...
...
nextjs/utils/fetchProxy.ts
View file @
db115fe7
...
...
@@ -32,8 +32,8 @@ export default function fetchFactory(
httpLogger
.
logger
.
info
({
message
:
'
API fetch via Next.js proxy
'
,
url
,
headers
,
init
,
//
headers,
//
init,
});
const
body
=
(()
=>
{
...
...
playwright/TestApp.tsx
View file @
db115fe7
...
...
@@ -10,6 +10,7 @@ import type { Props as PageProps } from 'nextjs/getServerSideProps';
import
config
from
'
configs/app
'
;
import
{
AppContextProvider
}
from
'
lib/contexts/app
'
;
import
{
MarketplaceContext
}
from
'
lib/contexts/marketplace
'
;
import
{
SocketProvider
}
from
'
lib/socket/context
'
;
import
currentChain
from
'
lib/web3/currentChain
'
;
import
theme
from
'
theme/theme
'
;
...
...
@@ -23,6 +24,10 @@ export type Props = {
appContext
?:
{
pageProps
:
PageProps
;
};
marketplaceContext
?:
{
isAutoConnectDisabled
:
boolean
;
setIsAutoConnectDisabled
:
(
isAutoConnectDisabled
:
boolean
)
=>
void
;
};
}
const
defaultAppContext
=
{
...
...
@@ -35,6 +40,11 @@ const defaultAppContext = {
},
};
const
defaultMarketplaceContext
=
{
isAutoConnectDisabled
:
false
,
setIsAutoConnectDisabled
:
()
=>
{},
};
const
wagmiConfig
=
createConfig
({
chains
:
[
currentChain
],
connectors
:
[
...
...
@@ -49,7 +59,7 @@ const wagmiConfig = createConfig({
},
});
const
TestApp
=
({
children
,
withSocket
,
appContext
=
defaultAppContext
}:
Props
)
=>
{
const
TestApp
=
({
children
,
withSocket
,
appContext
=
defaultAppContext
,
marketplaceContext
=
defaultMarketplaceContext
}:
Props
)
=>
{
const
[
queryClient
]
=
React
.
useState
(()
=>
new
QueryClient
({
defaultOptions
:
{
queries
:
{
...
...
@@ -64,11 +74,13 @@ const TestApp = ({ children, withSocket, appContext = defaultAppContext }: Props
<
QueryClientProvider
client=
{
queryClient
}
>
<
SocketProvider
url=
{
withSocket
?
`ws://${ config.app.host }:${ socketPort }`
:
undefined
}
>
<
AppContextProvider
{
...
appContext
}
>
<
GrowthBookProvider
>
<
WagmiProvider
config=
{
wagmiConfig
}
>
{
children
}
</
WagmiProvider
>
</
GrowthBookProvider
>
<
MarketplaceContext
.
Provider
value=
{
marketplaceContext
}
>
<
GrowthBookProvider
>
<
WagmiProvider
config=
{
wagmiConfig
}
>
{
children
}
</
WagmiProvider
>
</
GrowthBookProvider
>
</
MarketplaceContext
.
Provider
>
</
AppContextProvider
>
</
SocketProvider
>
</
QueryClientProvider
>
...
...
ui/snippets/auth/screens/AuthModalScreenOtpCode.tsx
View file @
db115fe7
...
...
@@ -86,7 +86,6 @@ const AuthModalScreenOtpCode = ({ email, onSuccess, isAuth }: Props) => {
description
:
'
Code has been sent to your email
'
,
});
}
catch
(
error
)
{
// TODO @tom2drum check cool down error
const
apiError
=
getErrorObjPayload
<
{
message
:
string
}
>
(
error
);
toast
({
...
...
ui/snippets/user/profile/UserProfileDesktop.pw.tsx
View file @
db115fe7
...
...
@@ -13,11 +13,11 @@ const test = base.extend<{ context: BrowserContext }>({
test
(
'
without address
'
,
async
({
render
,
page
,
mockApiResponse
})
=>
{
await
mockApiResponse
(
'
user_info
'
,
profileMock
.
base
);
await
render
(<
UserProfileDesktop
/>);
await
render
(<
UserProfileDesktop
/>
,
undefined
,
{
marketplaceContext
:
{
isAutoConnectDisabled
:
true
,
setIsAutoConnectDisabled
:
()
=>
{}
}
}
);
await
page
.
getByText
(
/tom/i
).
click
();
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
300
,
height
:
6
00
},
clip
:
{
x
:
0
,
y
:
0
,
width
:
300
,
height
:
7
00
},
});
});
...
...
ui/snippets/user/profile/__screenshots__/UserProfileDesktop.pw.tsx_default_without-address-1.png
View replaced file @
a3f9cc19
View file @
db115fe7
25.4 KB
|
W:
|
H:
28.9 KB
|
W:
|
H:
2-up
Swipe
Onion skin
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