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
bf339792
Commit
bf339792
authored
Feb 09, 2024
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
rollback buildUrl changes
parent
c7197bb4
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
7 additions
and
13 deletions
+7
-13
buildUrl.test.ts
lib/api/buildUrl.test.ts
+1
-1
buildUrl.ts
lib/api/buildUrl.ts
+1
-7
AddressTokenTransfers.pw.tsx
ui/address/AddressTokenTransfers.pw.tsx
+2
-2
AddressTokens.pw.tsx
ui/address/AddressTokens.pw.tsx
+2
-2
Tokens.pw.tsx
ui/pages/Tokens.pw.tsx
+1
-1
No files found.
lib/api/buildUrl.test.ts
View file @
bf339792
...
...
@@ -34,7 +34,7 @@ describe('falsy query parameters', () => {
test
(
'
builds URL with array-like query parameters
'
,
()
=>
{
const
url
=
buildUrl
(
'
block
'
,
{
height_or_hash
:
'
42
'
},
{
includeTx
:
[
'
0x11
'
,
'
0x22
'
],
sort
:
'
asc
'
});
expect
(
url
).
toBe
(
'
https://localhost:3003/api/v2/blocks/42?includeTx
%5B0%5D=0x11&includeTx%5B1%5D=
0x22&sort=asc
'
);
expect
(
url
).
toBe
(
'
https://localhost:3003/api/v2/blocks/42?includeTx
=0x11%2C
0x22&sort=asc
'
);
});
test
(
'
builds URL for resource with custom API endpoint
'
,
()
=>
{
...
...
lib/api/buildUrl.ts
View file @
bf339792
...
...
@@ -19,13 +19,7 @@ export default function buildUrl<R extends ResourceName>(
queryParams
&&
Object
.
entries
(
queryParams
).
forEach
(([
key
,
value
])
=>
{
// there are some pagination params that can be null or false for the next page
if
(
value
!==
undefined
&&
value
!==
''
)
{
if
(
Array
.
isArray
(
value
))
{
value
.
forEach
((
v
,
i
)
=>
url
.
searchParams
.
append
(
`
${
key
}
[
${
i
}
]`
,
String
(
v
)));
}
else
{
url
.
searchParams
.
append
(
key
,
String
(
value
));
}
}
value
!==
undefined
&&
value
!==
''
&&
url
.
searchParams
.
append
(
key
,
String
(
value
));
});
return
url
.
toString
();
...
...
ui/address/AddressTokenTransfers.pw.tsx
View file @
bf339792
...
...
@@ -108,7 +108,7 @@ test.describe('socket', () => {
},
};
const
API_URL_NO_TOKEN
=
buildApiUrl
(
'
address_token_transfers
'
,
{
hash
:
CURRENT_ADDRESS
});
const
API_URL_NO_TOKEN
=
buildApiUrl
(
'
address_token_transfers
'
,
{
hash
:
CURRENT_ADDRESS
})
+
'
?type=
'
;
await
page
.
route
(
API_URL_NO_TOKEN
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
...
...
@@ -144,7 +144,7 @@ test.describe('socket', () => {
},
};
const
API_URL_NO_TOKEN
=
buildApiUrl
(
'
address_token_transfers
'
,
{
hash
:
CURRENT_ADDRESS
});
const
API_URL_NO_TOKEN
=
buildApiUrl
(
'
address_token_transfers
'
,
{
hash
:
CURRENT_ADDRESS
})
+
'
?type=
'
;
await
page
.
route
(
API_URL_NO_TOKEN
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
...
...
ui/address/AddressTokens.pw.tsx
View file @
bf339792
...
...
@@ -13,8 +13,8 @@ import AddressTokens from './AddressTokens';
const
ADDRESS_HASH
=
addressMock
.
withName
.
hash
;
const
API_URL_ADDRESS
=
buildApiUrl
(
'
address
'
,
{
hash
:
ADDRESS_HASH
});
const
API_URL_TOKENS
=
buildApiUrl
(
'
address_tokens
'
,
{
hash
:
ADDRESS_HASH
});
const
API_URL_NFT
=
buildApiUrl
(
'
address_nfts
'
,
{
hash
:
ADDRESS_HASH
});
const
API_URL_COLLECTIONS
=
buildApiUrl
(
'
address_collections
'
,
{
hash
:
ADDRESS_HASH
});
const
API_URL_NFT
=
buildApiUrl
(
'
address_nfts
'
,
{
hash
:
ADDRESS_HASH
})
+
'
?type=
'
;
const
API_URL_COLLECTIONS
=
buildApiUrl
(
'
address_collections
'
,
{
hash
:
ADDRESS_HASH
})
+
'
?type=
'
;
const
nextPageParams
=
{
items_count
:
50
,
...
...
ui/pages/Tokens.pw.tsx
View file @
bf339792
...
...
@@ -111,7 +111,7 @@ base.describe('bridged tokens', async() => {
});
test
(
'
base view
'
,
async
({
mount
,
page
})
=>
{
await
page
.
route
(
BRIDGED_TOKENS_API_URL
+
'
?chain_ids
%5B0%5D
=99
'
,
(
route
)
=>
route
.
fulfill
({
await
page
.
route
(
BRIDGED_TOKENS_API_URL
+
'
?chain_ids=99
'
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
bridgedFilteredTokens
),
}));
...
...
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