mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* default TxEntity.noCopy to false remove redundant noCopy=false restore noCopy for tx hashes in this components This commit has no essential change, order than defaulting noCopy for TxEntity to false, and reversing the use of the prop * To reflect new default of TxEntity and UserOpEntity Updated tests to with-no-copy from with-copy remove outdated screenshots Regenerate screenshot for new default * display copy button for tx hash In the following pages: /txs, /internal-txs /token-transfers /address/txs, /address/token-transfers(tab) /deposits, /withdrawals /batches[id]/txs(tab) /advanced-filter * update snapshots * update snapshots
64 lines
1.3 KiB
TypeScript
64 lines
1.3 KiB
TypeScript
import React from 'react';
|
|
|
|
import { test, expect } from 'playwright/lib';
|
|
|
|
import UserOpEntity from './UserOpEntity';
|
|
|
|
const hash = '0x376db52955d5bce114d0ccea2dcf22289b4eae1b86bcae5a59bb5fdbfef48899';
|
|
const variants = [ 'subheading', 'content' ] as const;
|
|
|
|
test.use({ viewport: { width: 180, height: 30 } });
|
|
|
|
test.describe('variant', () => {
|
|
variants.forEach((variant) => {
|
|
test(`${ variant }`, async({ render }) => {
|
|
const component = await render(
|
|
<UserOpEntity
|
|
hash={ hash }
|
|
variant={ variant }
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
});
|
|
});
|
|
|
|
test('loading', async({ render }) => {
|
|
const component = await render(
|
|
<UserOpEntity
|
|
hash={ hash }
|
|
isLoading
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
test('with no copy +@dark-mode', async({ render }) => {
|
|
const component = await render(
|
|
<UserOpEntity
|
|
hash={ hash }
|
|
noCopy
|
|
/>,
|
|
);
|
|
|
|
await component.getByText(hash.slice(0, 4)).hover();
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
test('customization', async({ render }) => {
|
|
const component = await render(
|
|
<UserOpEntity
|
|
hash={ hash }
|
|
truncation="constant"
|
|
p={ 3 }
|
|
borderWidth="1px"
|
|
borderColor="blue.700"
|
|
/>,
|
|
);
|
|
|
|
await expect(component).toHaveScreenshot();
|
|
});
|