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
2dd9c540
Commit
2dd9c540
authored
Feb 23, 2023
by
tom
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
test for ChartWidget
parent
7a84590c
Changes
12
Hide whitespace changes
Inline
Side-by-side
Showing
12 changed files
with
76 additions
and
1 deletion
+76
-1
ChartWidget.pw.tsx
ui/shared/chart/ChartWidget.pw.tsx
+75
-0
ChartWidget.tsx
ui/shared/chart/ChartWidget.tsx
+1
-1
ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-1.png
...rtWidget.pw.tsx_dark-color-mode_base-view-dark-mode-1.png
+0
-0
ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-2.png
...rtWidget.pw.tsx_dark-color-mode_base-view-dark-mode-2.png
+0
-0
ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-3.png
...rtWidget.pw.tsx_dark-color-mode_base-view-dark-mode-3.png
+0
-0
ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-4.png
...rtWidget.pw.tsx_dark-color-mode_base-view-dark-mode-4.png
+0
-0
ChartWidget.pw.tsx_default_base-view-dark-mode-1.png
...ts__/ChartWidget.pw.tsx_default_base-view-dark-mode-1.png
+0
-0
ChartWidget.pw.tsx_default_base-view-dark-mode-2.png
...ts__/ChartWidget.pw.tsx_default_base-view-dark-mode-2.png
+0
-0
ChartWidget.pw.tsx_default_base-view-dark-mode-3.png
...ts__/ChartWidget.pw.tsx_default_base-view-dark-mode-3.png
+0
-0
ChartWidget.pw.tsx_default_base-view-dark-mode-4.png
...ts__/ChartWidget.pw.tsx_default_base-view-dark-mode-4.png
+0
-0
ChartWidget.pw.tsx_default_error-1.png
...rt/__screenshots__/ChartWidget.pw.tsx_default_error-1.png
+0
-0
ChartWidget.pw.tsx_default_loading-1.png
.../__screenshots__/ChartWidget.pw.tsx_default_loading-1.png
+0
-0
No files found.
ui/shared/chart/ChartWidget.pw.tsx
0 → 100644
View file @
2dd9c540
import
{
test
,
expect
}
from
'
@playwright/experimental-ct-react
'
;
import
React
from
'
react
'
;
import
TestApp
from
'
playwright/TestApp
'
;
import
type
{
Props
}
from
'
./ChartWidget
'
;
import
ChartWidget
from
'
./ChartWidget
'
;
test
.
use
({
viewport
:
{
width
:
400
,
height
:
300
}
});
const
props
:
Props
=
{
items
:
[
{
date
:
new
Date
(
'
2023-02-13
'
),
value
:
1.7631568828337087
},
{
date
:
new
Date
(
'
2023-02-14
'
),
value
:
9547912.248607066
},
{
date
:
new
Date
(
'
2023-02-15
'
),
value
:
19795391.669569757
},
{
date
:
new
Date
(
'
2023-02-16
'
),
value
:
18338481.6037719
},
{
date
:
new
Date
(
'
2023-02-17
'
),
value
:
18716729.946751505
},
{
date
:
new
Date
(
'
2023-02-18
'
),
value
:
32164355.603443976
},
{
date
:
new
Date
(
'
2023-02-19
'
),
value
:
20856850.45498412
},
{
date
:
new
Date
(
'
2023-02-20
'
),
value
:
18846303.416569296
},
{
date
:
new
Date
(
'
2023-02-21
'
),
value
:
26366091.117737416
},
{
date
:
new
Date
(
'
2023-02-22
'
),
value
:
30446292.68212635
},
{
date
:
new
Date
(
'
2023-02-23
'
),
value
:
25136740.887217894
},
],
title
:
'
Native coin circulating supply
'
,
description
:
'
Amount of token circulating supply for the period
'
,
units
:
'
ETH
'
,
isLoading
:
false
,
isError
:
false
,
};
test
(
'
base view +@dark-mode
'
,
async
({
mount
,
page
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
ChartWidget
{
...
props
}
/>
</
TestApp
>,
);
await
page
.
waitForFunction
(()
=>
{
return
document
.
querySelector
(
'
path[data-name="chart-Nativecoincirculatingsupply-small"]
'
)?.
getAttribute
(
'
opacity
'
)
===
'
1
'
;
});
await
expect
(
component
).
toHaveScreenshot
();
await
component
.
locator
(
'
.chakra-menu__menu-button
'
).
click
();
await
expect
(
component
).
toHaveScreenshot
();
await
page
.
mouse
.
move
(
0
,
0
);
await
page
.
mouse
.
click
(
0
,
0
);
await
page
.
mouse
.
move
(
100
,
150
);
await
expect
(
component
).
toHaveScreenshot
();
await
page
.
mouse
.
down
();
await
page
.
mouse
.
move
(
300
,
150
);
await
page
.
mouse
.
up
();
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
loading
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
ChartWidget
{
...
props
}
isLoading
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
test
(
'
error
'
,
async
({
mount
})
=>
{
const
component
=
await
mount
(
<
TestApp
>
<
ChartWidget
{
...
props
}
isError
/>
</
TestApp
>,
);
await
expect
(
component
).
toHaveScreenshot
();
});
ui/shared/chart/ChartWidget.tsx
View file @
2dd9c540
...
...
@@ -33,7 +33,7 @@ import ChartWidgetGraph from './ChartWidgetGraph';
import
ChartWidgetSkeleton
from
'
./ChartWidgetSkeleton
'
;
import
FullscreenChartModal
from
'
./FullscreenChartModal
'
;
type
Props
=
{
export
type
Props
=
{
items
?:
Array
<
TimeChartItem
>
;
title
:
string
;
description
?:
string
;
...
...
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-1.png
0 → 100644
View file @
2dd9c540
15 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-2.png
0 → 100644
View file @
2dd9c540
23.9 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-3.png
0 → 100644
View file @
2dd9c540
19.2 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_dark-color-mode_base-view-dark-mode-4.png
0 → 100644
View file @
2dd9c540
15.7 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_base-view-dark-mode-1.png
0 → 100644
View file @
2dd9c540
14.2 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_base-view-dark-mode-2.png
0 → 100644
View file @
2dd9c540
22.5 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_base-view-dark-mode-3.png
0 → 100644
View file @
2dd9c540
18.5 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_base-view-dark-mode-4.png
0 → 100644
View file @
2dd9c540
14.8 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_error-1.png
0 → 100644
View file @
2dd9c540
9.96 KB
ui/shared/chart/__screenshots__/ChartWidget.pw.tsx_default_loading-1.png
0 → 100644
View file @
2dd9c540
15.8 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