forked from blockscout/frontend
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
15 changed files
with
229 additions
and
16 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,128 @@ | ||
export const base = { | ||
chart_data: [ | ||
{ | ||
date: '2022-11-28', | ||
tx_count: 26815, | ||
}, | ||
{ | ||
date: '2022-11-27', | ||
tx_count: 34784, | ||
}, | ||
{ | ||
date: '2022-11-26', | ||
tx_count: 77527, | ||
}, | ||
{ | ||
date: '2022-11-25', | ||
tx_count: 39687, | ||
}, | ||
{ | ||
date: '2022-11-24', | ||
tx_count: 40752, | ||
}, | ||
{ | ||
date: '2022-11-23', | ||
tx_count: 32569, | ||
}, | ||
{ | ||
date: '2022-11-22', | ||
tx_count: 34449, | ||
}, | ||
{ | ||
date: '2022-11-21', | ||
tx_count: 106047, | ||
}, | ||
{ | ||
date: '2022-11-20', | ||
tx_count: 107713, | ||
}, | ||
{ | ||
date: '2022-11-19', | ||
tx_count: 96311, | ||
}, | ||
{ | ||
date: '2022-11-18', | ||
tx_count: 30828, | ||
}, | ||
{ | ||
date: '2022-11-17', | ||
tx_count: 27422, | ||
}, | ||
{ | ||
date: '2022-11-16', | ||
tx_count: 75898, | ||
}, | ||
{ | ||
date: '2022-11-15', | ||
tx_count: 84084, | ||
}, | ||
{ | ||
date: '2022-11-14', | ||
tx_count: 62266, | ||
}, | ||
{ | ||
date: '2022-11-13', | ||
tx_count: 22338, | ||
}, | ||
{ | ||
date: '2022-11-12', | ||
tx_count: 86764, | ||
}, | ||
{ | ||
date: '2022-11-11', | ||
tx_count: 79493, | ||
}, | ||
{ | ||
date: '2022-11-10', | ||
tx_count: 92887, | ||
}, | ||
{ | ||
date: '2022-11-09', | ||
tx_count: 43691, | ||
}, | ||
{ | ||
date: '2022-11-08', | ||
tx_count: 74197, | ||
}, | ||
{ | ||
date: '2022-11-07', | ||
tx_count: 58131, | ||
}, | ||
{ | ||
date: '2022-11-06', | ||
tx_count: 62477, | ||
}, | ||
{ | ||
date: '2022-11-05', | ||
tx_count: 82897, | ||
}, | ||
{ | ||
date: '2022-11-04', | ||
tx_count: 91725, | ||
}, | ||
{ | ||
date: '2022-11-03', | ||
tx_count: 83667, | ||
}, | ||
{ | ||
date: '2022-11-02', | ||
tx_count: 63743, | ||
}, | ||
{ | ||
date: '2022-11-01', | ||
tx_count: 152059, | ||
}, | ||
{ | ||
date: '2022-10-31', | ||
tx_count: 62519, | ||
}, | ||
{ | ||
date: '2022-10-30', | ||
tx_count: 48569, | ||
}, | ||
{ | ||
date: '2022-10-29', | ||
tx_count: 36789, | ||
}, | ||
], | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
import type { Stats } from 'types/api/stats'; | ||
|
||
export const base: Stats = { | ||
average_block_time: 6212.0, | ||
coin_price: '0.00199678', | ||
gas_prices: { | ||
average: 48.0, | ||
fast: 67.5, | ||
slow: 48.0, | ||
}, | ||
gas_used_today: '4108680603', | ||
market_cap: '330809.96443288102524', | ||
network_utilization_percentage: 1.55372064, | ||
static_gas_price: '10', | ||
total_addresses: '19667249', | ||
total_blocks: '30215608', | ||
total_gas_used: '0', | ||
total_transactions: '82258122', | ||
transactions_today: '26815', | ||
}; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
import { test, expect } from '@playwright/experimental-ct-react'; | ||
import React from 'react'; | ||
|
||
import * as statsMock from 'mocks/stats/index'; | ||
import TestApp from 'playwright/TestApp'; | ||
|
||
import Stats from './Stats'; | ||
|
||
const API_URL = '/node-api/stats'; | ||
|
||
test('all items +@mobile +@dark-mode +@desktop-xl', async({ mount, page }) => { | ||
await page.route(API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(statsMock.base), | ||
})); | ||
|
||
const component = await mount( | ||
<TestApp> | ||
<Stats/> | ||
</TestApp>, | ||
); | ||
await page.waitForResponse(API_URL), | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file added
BIN
+12.4 KB
...hots__/Stats.pw.tsx_dark-color-mode_all-items-mobile-dark-mode-desktop-xl-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.4 KB
..._screenshots__/Stats.pw.tsx_default_all-items-mobile-dark-mode-desktop-xl-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+12.1 KB
...reenshots__/Stats.pw.tsx_desktop-xl_all-items-mobile-dark-mode-desktop-xl-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+15.3 KB
...__screenshots__/Stats.pw.tsx_mobile_all-items-mobile-dark-mode-desktop-xl-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
import { test, expect } from '@playwright/experimental-ct-react'; | ||
import React from 'react'; | ||
|
||
import * as dailyTxsMock from 'mocks/stats/daily_txs'; | ||
import * as statsMock from 'mocks/stats/index'; | ||
import TestApp from 'playwright/TestApp'; | ||
|
||
import ChainIndicators from './ChainIndicators'; | ||
|
||
const STATS_API_URL = '/node-api/stats'; | ||
const TX_CHART_API_URL = '/node-api/stats/charts/transactions'; | ||
|
||
test('daily txs chart +@mobile +@dark-mode +@dark-mode-mobile', async({ mount, page }) => { | ||
await page.route(STATS_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(statsMock.base), | ||
})); | ||
await page.route(TX_CHART_API_URL, (route) => route.fulfill({ | ||
status: 200, | ||
body: JSON.stringify(dailyTxsMock.base), | ||
})); | ||
|
||
const component = await mount( | ||
<TestApp> | ||
<ChainIndicators/> | ||
</TestApp>, | ||
); | ||
await page.waitForResponse(STATS_API_URL), | ||
await page.hover('.ChartOverlay', { position: { x: 100, y: 100 } }); | ||
|
||
await expect(component).toHaveScreenshot(); | ||
}); |
Binary file added
BIN
+28.3 KB
..._dark-color-mode-mobile_daily-txs-chart-mobile-dark-mode-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+50.8 KB
....pw.tsx_dark-color-mode_daily-txs-chart-mobile-dark-mode-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+49.6 KB
...dicators.pw.tsx_default_daily-txs-chart-mobile-dark-mode-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added
BIN
+28.1 KB
...ndicators.pw.tsx_mobile_daily-txs-chart-mobile-dark-mode-dark-mode-mobile-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.