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
adad0d40
Commit
adad0d40
authored
Apr 10, 2024
by
Max Alekseenko
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
add tests
parent
3b9cbad3
Changes
8
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
126 additions
and
1 deletion
+126
-1
banner.html
playwright/mocks/banner.html
+94
-0
Marketplace.pw.tsx
ui/pages/Marketplace.pw.tsx
+32
-1
Marketplace.pw.tsx_dark-color-mode_with-banner-mobile-dark-mode-1.png
...pw.tsx_dark-color-mode_with-banner-mobile-dark-mode-1.png
+0
-0
Marketplace.pw.tsx_dark-color-mode_with-featured-app-mobile-dark-mode-1.png
..._dark-color-mode_with-featured-app-mobile-dark-mode-1.png
+0
-0
Marketplace.pw.tsx_default_with-banner-mobile-dark-mode-1.png
...etplace.pw.tsx_default_with-banner-mobile-dark-mode-1.png
+0
-0
Marketplace.pw.tsx_default_with-featured-app-mobile-dark-mode-1.png
...e.pw.tsx_default_with-featured-app-mobile-dark-mode-1.png
+0
-0
Marketplace.pw.tsx_mobile_with-banner-mobile-dark-mode-1.png
...ketplace.pw.tsx_mobile_with-banner-mobile-dark-mode-1.png
+0
-0
Marketplace.pw.tsx_mobile_with-featured-app-mobile-dark-mode-1.png
...ce.pw.tsx_mobile_with-featured-app-mobile-dark-mode-1.png
+0
-0
No files found.
playwright/mocks/banner.html
0 → 100644
View file @
adad0d40
This diff is collapsed.
Click to expand it.
ui/pages/Marketplace.pw.tsx
View file @
adad0d40
...
...
@@ -13,6 +13,9 @@ import Marketplace from './Marketplace';
const
MARKETPLACE_CONFIG_URL
=
app
.
url
+
buildExternalAssetFilePath
(
'
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL
'
,
'
https://marketplace-config.json
'
)
||
''
;
const
MARKETPLACE_SECURITY_REPORTS_URL
=
app
.
url
+
buildExternalAssetFilePath
(
'
NEXT_PUBLIC_MARKETPLACE_SECURITY_REPORTS_URL
'
,
'
https://marketplace-security-reports.json
'
)
||
''
;
const
MARKETPLACE_BANNER_CONTENT_URL
=
app
.
url
+
buildExternalAssetFilePath
(
'
NEXT_PUBLIC_MARKETPLACE_BANNER_CONTENT_URL
'
,
'
https://marketplace-banner.html
'
)
||
''
;
const
MARKETPLACE_BANNER_LINK_URL
=
'
https://example.com
'
;
const
test
=
base
.
extend
({
context
:
contextWithEnvs
([
...
...
@@ -21,7 +24,7 @@ const test = base.extend({
])
as
any
,
});
test
(
'
base view +@mobile +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
const
testFn
:
Parameters
<
typeof
test
>
[
1
]
=
async
({
mount
,
page
})
=>
{
await
page
.
route
(
MARKETPLACE_CONFIG_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
body
:
JSON
.
stringify
(
appsMock
),
...
...
@@ -36,6 +39,11 @@ test('base view +@mobile +@dark-mode', async({ mount, page }) => {
),
));
await
page
.
route
(
MARKETPLACE_BANNER_CONTENT_URL
,
(
route
)
=>
route
.
fulfill
({
status
:
200
,
path
:
'
./playwright/mocks/banner.html
'
,
}));
const
component
=
await
mount
(
<
TestApp
>
<
Marketplace
/>
...
...
@@ -43,8 +51,31 @@ test('base view +@mobile +@dark-mode', async({ mount, page }) => {
);
await
expect
(
component
).
toHaveScreenshot
();
};
test
(
'
base view +@mobile +@dark-mode
'
,
testFn
);
const
testWithFeaturedApp
=
test
.
extend
({
context
:
contextWithEnvs
([
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL
'
,
value
:
MARKETPLACE_CONFIG_URL
},
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_FEATURED_APP
'
,
value
:
'
hop-exchange
'
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
])
as
any
,
});
testWithFeaturedApp
(
'
with featured app +@mobile +@dark-mode
'
,
testFn
);
const
testWithBanner
=
test
.
extend
({
context
:
contextWithEnvs
([
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL
'
,
value
:
MARKETPLACE_CONFIG_URL
},
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_BANNER_CONTENT_URL
'
,
value
:
MARKETPLACE_BANNER_CONTENT_URL
},
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_BANNER_LINK_URL
'
,
value
:
MARKETPLACE_BANNER_LINK_URL
},
// eslint-disable-next-line @typescript-eslint/no-explicit-any
])
as
any
,
});
testWithBanner
(
'
with banner +@mobile +@dark-mode
'
,
testFn
);
const
testWithScoreFeature
=
test
.
extend
({
context
:
contextWithEnvs
([
{
name
:
'
NEXT_PUBLIC_MARKETPLACE_CONFIG_URL
'
,
value
:
MARKETPLACE_CONFIG_URL
},
...
...
ui/pages/__screenshots__/Marketplace.pw.tsx_dark-color-mode_with-banner-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
146 KB
ui/pages/__screenshots__/Marketplace.pw.tsx_dark-color-mode_with-featured-app-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
81.7 KB
ui/pages/__screenshots__/Marketplace.pw.tsx_default_with-banner-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
144 KB
ui/pages/__screenshots__/Marketplace.pw.tsx_default_with-featured-app-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
80.8 KB
ui/pages/__screenshots__/Marketplace.pw.tsx_mobile_with-banner-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
72.8 KB
ui/pages/__screenshots__/Marketplace.pw.tsx_mobile_with-featured-app-mobile-dark-mode-1.png
0 → 100644
View file @
adad0d40
56 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