mirror of
https://github.com/luxfi/explore.git
synced 2026-09-24 00:28:18 +00:00
* epochs page * epoch rewards distribution * epoch election rewards * address epoch rewards * block epoch tag * add some tests * adjust epoch details for L1 epochs * support non-finalized epochs * fixes after design review * add truncation to block numbers on mobile * update epochs table layout * update timestamp hint * fix bug with subheading of first epoch * fixes of mobile view * update screenshots
36 lines
1.2 KiB
TypeScript
36 lines
1.2 KiB
TypeScript
import React from 'react';
|
|
|
|
import * as celoEpochMock from 'mocks/epochs/celo';
|
|
import { test, expect } from 'playwright/lib';
|
|
|
|
import EpochElectionRewards from './EpochElectionRewards';
|
|
|
|
const number = '1234';
|
|
const hooksConfig = {
|
|
router: {
|
|
query: { number },
|
|
},
|
|
};
|
|
|
|
test('base view', async({ render, mockApiResponse }) => {
|
|
await mockApiResponse(
|
|
'general:epoch_celo_election_rewards',
|
|
celoEpochMock.electionRewardDetails1,
|
|
{ pathParams: { number, reward_type: 'voter' } },
|
|
);
|
|
const component = await render(<EpochElectionRewards data={ celoEpochMock.epoch1 }/>, { hooksConfig });
|
|
await component.getByRole('cell', { name: 'Voting rewards' }).click();
|
|
await expect(component).toHaveScreenshot();
|
|
});
|
|
|
|
test('base view +@mobile -@default', async({ render, mockApiResponse }) => {
|
|
await mockApiResponse(
|
|
'general:epoch_celo_election_rewards',
|
|
celoEpochMock.electionRewardDetails1,
|
|
{ pathParams: { number, reward_type: 'voter' } },
|
|
);
|
|
const component = await render(<EpochElectionRewards data={ celoEpochMock.epoch1 }/>, { hooksConfig });
|
|
await component.locator('div').filter({ hasText: 'Voting rewards' }).nth(3).click();
|
|
await expect(component).toHaveScreenshot();
|
|
});
|