Commit d27a4750 authored by tom's avatar tom

TxLogTopic test

parent 28070d4d
import { test, expect } from '@playwright/experimental-ct-react';
import React from 'react';
import RenderWithChakra from 'playwright/RenderWithChakra';
import { MOBILE } from 'playwright/viewports';
import TxLogTopic from './TxLogTopic';
test.use({ viewport: MOBILE });
test('address view', async({ mount }) => {
const component = await mount(
<RenderWithChakra>
<TxLogTopic hex="0x000000000000000000000000d789a607ceac2f0e14867de4eb15b15c9ffb5859" index={ 42 }/>
</RenderWithChakra>,
);
await component.locator('select[aria-label="Data type"]').selectOption('address');
await expect(component).toHaveScreenshot();
});
test('hex view', async({ mount }) => {
const component = await mount(
<RenderWithChakra>
<TxLogTopic hex="0x000000000000000000000000d789a607ceac2f0e14867de4eb15b15c9ffb5859" index={ 42 }/>
</RenderWithChakra>,
);
await component.locator('select[aria-label="Data type"]').selectOption('hex');
await expect(component).toHaveScreenshot();
});
......@@ -74,6 +74,7 @@ const TxLogTopic = ({ hex, index }: Props) => {
mr={ 3 }
flexShrink={ 0 }
w="auto"
aria-label="Data type"
>
{ OPTIONS.map((option) => <option key={ option } value={ option }>{ capitalize(option) }</option>) }
</Select>
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment