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
45394dcf
Unverified
Commit
45394dcf
authored
Jul 10, 2023
by
Igor Stuev
Committed by
GitHub
Jul 10, 2023
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
search suggest fix (#1000)
parent
5a18d1a7
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
28 additions
and
1 deletion
+28
-1
SearchBar.pw.tsx
ui/snippets/searchBar/SearchBar.pw.tsx
+27
-0
SearchBar.tsx
ui/snippets/searchBar/SearchBar.tsx
+1
-1
SearchBar.pw.tsx_dark-color-mode_search-by-name-homepage-dark-mode-1.png
...x_dark-color-mode_search-by-name-homepage-dark-mode-1.png
+0
-0
SearchBar.pw.tsx_default_search-by-name-homepage-dark-mode-1.png
...ar.pw.tsx_default_search-by-name-homepage-dark-mode-1.png
+0
-0
No files found.
ui/snippets/searchBar/SearchBar.pw.tsx
View file @
45394dcf
import
{
LightMode
}
from
'
@chakra-ui/react
'
;
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
...
...
@@ -51,6 +52,32 @@ test('search by name +@mobile +@dark-mode', async({ mount, page }) => {
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
1200
,
height
:
500
}
});
});
test
(
'
search by name homepage +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
const
API_URL
=
buildApiUrl
(
'
search
'
)
+
'
?q=o
'
;
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
({
items
:
[
searchMock
.
token1
,
searchMock
.
token2
,
searchMock
.
contract1
,
],
}),
}));
await
mount
(
<
TestApp
>
<
LightMode
>
<
SearchBar
isHomepage
/>
</
LightMode
>
</
TestApp
>,
);
await
page
.
getByPlaceholder
(
/search/i
).
type
(
'
o
'
);
await
page
.
waitForResponse
(
API_URL
);
await
expect
(
page
).
toHaveScreenshot
({
clip
:
{
x
:
0
,
y
:
0
,
width
:
1200
,
height
:
500
}
});
});
test
(
'
search by tag +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
const
API_URL
=
buildApiUrl
(
'
search
'
)
+
'
?q=o
'
;
await
page
.
route
(
API_URL
,
(
route
)
=>
route
.
fulfill
({
...
...
ui/snippets/searchBar/SearchBar.tsx
View file @
45394dcf
...
...
@@ -120,7 +120,7 @@ const SearchBar = ({ isHomepage }: Props) => {
/>
</
PopoverTrigger
>
<
PopoverContent
w=
{
`${ menuWidth.current }px`
}
maxH=
{
{
base
:
'
300px
'
,
lg
:
'
500px
'
}
}
overflowY=
"scroll"
ref=
{
menuRef
}
>
<
PopoverBody
py=
{
6
}
sx=
{
isHomepage
?
{
mark
:
{
bgColor
:
'
green.100
'
}
}
:
{}
}
>
<
PopoverBody
py=
{
6
}
sx=
{
isHomepage
?
{
mark
:
{
bgColor
:
'
green.100
'
}
}
:
{}
}
color=
"chakra-body-text"
>
{
searchTerm
.
trim
().
length
===
0
&&
recentSearchKeywords
.
length
>
0
&&
(
<
SearchBarRecentKeywords
onClick=
{
handleSearchTermChange
}
onClear=
{
onClose
}
/>
)
}
...
...
ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_dark-color-mode_search-by-name-homepage-dark-mode-1.png
0 → 100644
View file @
45394dcf
36.2 KB
ui/snippets/searchBar/__screenshots__/SearchBar.pw.tsx_default_search-by-name-homepage-dark-mode-1.png
0 → 100644
View file @
45394dcf
36.9 KB
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