mirror of
https://github.com/hanzonet/explore.git
synced 2026-10-30 18:16:57 +00:00
* [WIP] chart for secondary coin price * latest L1 state batch snippet * txs stats snipper * Merge main branch * optimism preset * rename governance token into secondary coin * add secondary coin price to top bar * calculate usd value for avg tx fee * tests * tweaks * change envs for demo * fix tests * fixes * fix flaky test * change scroll to filter for stats link behaviour
62 lines
1.4 KiB
TypeScript
62 lines
1.4 KiB
TypeScript
import React from 'react';
|
|
|
|
import { test, expect } from 'playwright/lib';
|
|
|
|
import StatsWidget from './StatsWidget';
|
|
|
|
test.use({ viewport: { width: 300, height: 100 } });
|
|
|
|
test('with positive diff +@dark-mode', async({ render }) => {
|
|
const component = await render(
|
|
<StatsWidget
|
|
label="Verified contracts"
|
|
hint="Contracts that have been verified"
|
|
value="1 000 000"
|
|
diff={ 4200 }
|
|
diffFormatted="4 200"
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
// according to current logic we don't show diff if it's negative
|
|
test('with negative diff', async({ render }) => {
|
|
const component = await render(
|
|
<StatsWidget
|
|
label="Verified contracts"
|
|
hint="Contracts that have been verified"
|
|
value="1,000,000"
|
|
diff={ -4200 }
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
test('loading state', async({ render }) => {
|
|
const component = await render(
|
|
<StatsWidget
|
|
label="Verified contracts"
|
|
hint="Contracts that have been verified"
|
|
value="1,000,000"
|
|
isLoading
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
test('with period only', async({ render }) => {
|
|
const component = await render(
|
|
<StatsWidget
|
|
label="Verified contracts"
|
|
hint="Contracts that have been verified"
|
|
value="1,000,000"
|
|
period="1h"
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|