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
be1ef124
Commit
be1ef124
authored
Jun 30, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix clear button placement
parent
e04c3b6c
Changes
8
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
39 additions
and
1 deletion
+39
-1
SearchBarInput.pw.tsx
ui/snippets/searchBar/SearchBarInput.pw.tsx
+38
-0
SearchBarInput.tsx
ui/snippets/searchBar/SearchBarInput.tsx
+1
-1
SearchBarInput.pw.tsx_dark-color-mode_input-on-home-page-mobile-dark-mode-1.png
...dark-color-mode_input-on-home-page-mobile-dark-mode-1.png
+0
-0
SearchBarInput.pw.tsx_dark-color-mode_input-on-regular-page-mobile-dark-mode-1.png
...k-color-mode_input-on-regular-page-mobile-dark-mode-1.png
+0
-0
SearchBarInput.pw.tsx_default_input-on-home-page-mobile-dark-mode-1.png
....pw.tsx_default_input-on-home-page-mobile-dark-mode-1.png
+0
-0
SearchBarInput.pw.tsx_default_input-on-regular-page-mobile-dark-mode-1.png
....tsx_default_input-on-regular-page-mobile-dark-mode-1.png
+0
-0
SearchBarInput.pw.tsx_mobile_input-on-home-page-mobile-dark-mode-1.png
...t.pw.tsx_mobile_input-on-home-page-mobile-dark-mode-1.png
+0
-0
SearchBarInput.pw.tsx_mobile_input-on-regular-page-mobile-dark-mode-1.png
...w.tsx_mobile_input-on-regular-page-mobile-dark-mode-1.png
+0
-0
No files found.
ui/snippets/searchBar/SearchBarInput.pw.tsx
0 → 100644
View file @
be1ef124
import
{
LightMode
}
from
'
@chakra-ui/react
'
;
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
SearchBarInput
from
'
./SearchBarInput
'
;
const
props
=
{
onChange
:
()
=>
{},
onSubmit
:
()
=>
{},
onClear
:
()
=>
{},
value
:
'
duck duck
'
,
};
test
(
'
input on regular page +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
mount
(
<
TestApp
>
<
SearchBarInput
{
...
props
}
/>
</
TestApp
>,
);
const
input
=
page
.
getByPlaceholder
(
/search by/i
);
await
expect
(
input
).
toHaveScreenshot
();
});
test
(
'
input on home page +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
await
mount
(
<
TestApp
>
<
LightMode
>
<
SearchBarInput
{
...
props
}
isHomepage
/>
</
LightMode
>
</
TestApp
>,
);
const
input
=
page
.
getByPlaceholder
(
/search by/i
);
await
expect
(
input
).
toHaveScreenshot
();
});
ui/snippets/searchBar/SearchBarInput.tsx
View file @
be1ef124
...
@@ -107,7 +107,7 @@ const SearchBarInput = ({ onChange, onSubmit, isHomepage, onFocus, onBlur, onHid
...
@@ -107,7 +107,7 @@ const SearchBarInput = ({ onChange, onSubmit, isHomepage, onFocus, onBlur, onHid
value=
{
value
}
value=
{
value
}
/>
/>
{
value
&&
(
{
value
&&
(
<
InputRightElement
top=
{
{
base
:
2
,
lg
:
'
18px
'
}
}
right=
{
2
}
>
<
InputRightElement
top=
{
{
base
:
isHomepage
?
'
18px
'
:
2
,
lg
:
'
18px
'
}
}
right=
{
2
}
>
<
ClearButton
onClick=
{
onClear
}
/>
<
ClearButton
onClick=
{
onClear
}
/>
</
InputRightElement
>
</
InputRightElement
>
)
}
)
}
...
...
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_dark-color-mode_input-on-home-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
2.71 KB
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_dark-color-mode_input-on-regular-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
2.89 KB
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_default_input-on-home-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
2.38 KB
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_default_input-on-regular-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
2.75 KB
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_mobile_input-on-home-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
1.93 KB
ui/snippets/searchBar/__screenshots__/SearchBarInput.pw.tsx_mobile_input-on-regular-page-mobile-dark-mode-1.png
0 → 100644
View file @
be1ef124
1.98 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