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
1ec77495
Commit
1ec77495
authored
Aug 27, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
update tests
parent
d13961ce
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
28 additions
and
9 deletions
+28
-9
.env.pw
configs/envs/.env.pw
+1
-0
WalletMenuDesktop.pw.tsx
ui/snippets/walletMenu/WalletMenuDesktop.pw.tsx
+14
-6
WalletMenuMobile.pw.tsx
ui/snippets/walletMenu/WalletMenuMobile.pw.tsx
+13
-3
No files found.
configs/envs/.env.pw
View file @
1ec77495
...
@@ -52,5 +52,6 @@ NEXT_PUBLIC_STATS_API_HOST=http://localhost:3004
...
@@ -52,5 +52,6 @@ NEXT_PUBLIC_STATS_API_HOST=http://localhost:3004
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=http://localhost:3005
NEXT_PUBLIC_CONTRACT_INFO_API_HOST=http://localhost:3005
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=http://localhost:3006
NEXT_PUBLIC_ADMIN_SERVICE_API_HOST=http://localhost:3006
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=http://localhost:3007
NEXT_PUBLIC_METADATA_SERVICE_API_HOST=http://localhost:3007
NEXT_PUBLIC_NAME_SERVICE_API_HOST=http://localhost:3008
NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY=xxx
NEXT_PUBLIC_RE_CAPTCHA_APP_SITE_KEY=xxx
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=xxx
NEXT_PUBLIC_WALLET_CONNECT_PROJECT_ID=xxx
ui/snippets/walletMenu/WalletMenuDesktop.pw.tsx
View file @
1ec77495
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Address
}
from
'
types/api/addres
s
'
;
import
type
*
as
bens
from
'
@blockscout/bens-type
s
'
;
import
config
from
'
configs/app
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
domainMock
from
'
mocks/ens/domain
'
;
import
{
test
,
expect
}
from
'
playwright/lib
'
;
import
{
test
,
expect
}
from
'
playwright/lib
'
;
import
{
WalletMenuDesktop
}
from
'
./WalletMenuDesktop
'
;
import
{
WalletMenuDesktop
}
from
'
./WalletMenuDesktop
'
;
...
@@ -35,7 +37,11 @@ test('wallet is loading', async({ page, render }) => {
...
@@ -35,7 +37,11 @@ test('wallet is loading', async({ page, render }) => {
});
});
test
(
'
wallet connected +@dark-mode
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
test
(
'
wallet connected +@dark-mode
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
await
mockApiResponse
(
'
address
'
,
addressMock
.
eoa
,
{
pathParams
:
{
hash
:
addressMock
.
hash
}
});
await
mockApiResponse
(
'
address_domain
'
,
{
domain
:
undefined
,
resolved_domains_count
:
0
}
as
bens
.
GetAddressResponse
,
{
pathParams
:
{
address
:
addressMock
.
hash
,
chainId
:
config
.
chain
.
id
}
},
);
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
await
component
.
locator
(
'
button
'
).
click
();
await
component
.
locator
(
'
button
'
).
click
();
...
@@ -43,9 +49,7 @@ test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) =>
...
@@ -43,9 +49,7 @@ test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) =>
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
250
,
height
:
300
}
});
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
250
,
height
:
300
}
});
});
});
test
(
'
wallet connected (home page) +@dark-mode
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
test
(
'
wallet connected (home page) +@dark-mode
'
,
async
({
page
,
render
})
=>
{
await
mockApiResponse
(
'
address
'
,
addressMock
.
eoa
,
{
pathParams
:
{
hash
:
addressMock
.
hash
}
});
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isHomePage
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isHomePage
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
await
component
.
locator
(
'
button
'
).
click
();
await
component
.
locator
(
'
button
'
).
click
();
...
@@ -53,7 +57,11 @@ test('wallet connected (home page) +@dark-mode', async({ page, render, mockApiRe
...
@@ -53,7 +57,11 @@ test('wallet connected (home page) +@dark-mode', async({ page, render, mockApiRe
});
});
test
(
'
wallet with ENS connected
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
test
(
'
wallet with ENS connected
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
await
mockApiResponse
(
'
address
'
,
{
...
addressMock
.
eoa
,
...
addressMock
.
withEns
}
as
Address
,
{
pathParams
:
{
hash
:
addressMock
.
hash
}
});
await
mockApiResponse
(
'
address_domain
'
,
{
domain
:
domainMock
.
ensDomainB
,
resolved_domains_count
:
1
}
as
bens
.
GetAddressResponse
,
{
pathParams
:
{
address
:
addressMock
.
hash
,
chainId
:
config
.
chain
.
id
}
},
);
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
const
component
=
await
render
(<
WalletMenuDesktop
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
await
component
.
locator
(
'
button
'
).
click
();
await
component
.
locator
(
'
button
'
).
click
();
...
...
ui/snippets/walletMenu/WalletMenuMobile.pw.tsx
View file @
1ec77495
import
React
from
'
react
'
;
import
React
from
'
react
'
;
import
type
{
Address
}
from
'
types/api/addres
s
'
;
import
type
*
as
bens
from
'
@blockscout/bens-type
s
'
;
import
config
from
'
configs/app
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
addressMock
from
'
mocks/address/address
'
;
import
*
as
domainMock
from
'
mocks/ens/domain
'
;
import
{
test
,
expect
,
devices
}
from
'
playwright/lib
'
;
import
{
test
,
expect
,
devices
}
from
'
playwright/lib
'
;
import
{
WalletMenuMobile
}
from
'
./WalletMenuMobile
'
;
import
{
WalletMenuMobile
}
from
'
./WalletMenuMobile
'
;
...
@@ -30,7 +32,11 @@ test('wallet is loading', async({ page, render }) => {
...
@@ -30,7 +32,11 @@ test('wallet is loading', async({ page, render }) => {
});
});
test
(
'
wallet connected +@dark-mode
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
test
(
'
wallet connected +@dark-mode
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
await
mockApiResponse
(
'
address
'
,
addressMock
.
eoa
,
{
pathParams
:
{
hash
:
addressMock
.
hash
}
});
await
mockApiResponse
(
'
address_domain
'
,
{
domain
:
undefined
,
resolved_domains_count
:
0
}
as
bens
.
GetAddressResponse
,
{
pathParams
:
{
address
:
addressMock
.
hash
,
chainId
:
config
.
chain
.
id
}
},
);
const
component
=
await
render
(<
WalletMenuMobile
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
const
component
=
await
render
(<
WalletMenuMobile
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
await
component
.
locator
(
'
button
'
).
click
();
await
component
.
locator
(
'
button
'
).
click
();
...
@@ -39,7 +45,11 @@ test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) =>
...
@@ -39,7 +45,11 @@ test('wallet connected +@dark-mode', async({ page, render, mockApiResponse }) =>
});
});
test
(
'
wallet with ENS connected
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
test
(
'
wallet with ENS connected
'
,
async
({
page
,
render
,
mockApiResponse
})
=>
{
await
mockApiResponse
(
'
address
'
,
{
...
addressMock
.
eoa
,
...
addressMock
.
withEns
}
as
Address
,
{
pathParams
:
{
hash
:
addressMock
.
hash
}
});
await
mockApiResponse
(
'
address_domain
'
,
{
domain
:
domainMock
.
ensDomainB
,
resolved_domains_count
:
1
}
as
bens
.
GetAddressResponse
,
{
pathParams
:
{
address
:
addressMock
.
hash
,
chainId
:
config
.
chain
.
id
}
},
);
const
component
=
await
render
(<
WalletMenuMobile
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
const
component
=
await
render
(<
WalletMenuMobile
{
...
props
}
isWalletConnected
address=
{
addressMock
.
hash
}
/>);
await
component
.
locator
(
'
button
'
).
click
();
await
component
.
locator
(
'
button
'
).
click
();
...
...
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