Add logic to dynamically exclude bots visits in tags table

This commit is contained in:
Alejandro Celaya
2023-03-19 10:32:11 +01:00
parent 8fa61a6301
commit 4ebe23e89f
10 changed files with 35 additions and 20 deletions

View File

@@ -10,7 +10,7 @@ import { renderWithEvents } from '../__helpers__/setUpTest';
describe('<TagsList />', () => {
const filterTags = jest.fn();
const TagsListComp = createTagsList(() => <>TagsTable</>);
const TagsListComp = createTagsList(({ sortedTags }) => <>TagsTable ({sortedTags.map((t) => t.visits).join(',')})</>);
const setUp = (tagsList: Partial<TagsList>) => renderWithEvents(
<TagsListComp
{...Mock.all<TagsListProps>()}

View File

@@ -2,7 +2,7 @@ import { screen } from '@testing-library/react';
import { useLocation } from 'react-router-dom';
import { Mock } from 'ts-mockery';
import type { SelectedServer } from '../../src/servers/data';
import type { NormalizedTag } from '../../src/tags/data';
import type { SimplifiedTag } from '../../src/tags/data';
import { TagsTable as createTagsTable } from '../../src/tags/TagsTable';
import { rangeOf } from '../../src/utils/utils';
import { renderWithEvents } from '../__helpers__/setUpTest';
@@ -17,7 +17,7 @@ describe('<TagsTable />', () => {
(useLocation as any).mockReturnValue({ search });
return renderWithEvents(
<TagsTable
sortedTags={sortedTags.map((tag) => Mock.of<NormalizedTag>({ tag }))}
sortedTags={sortedTags.map((tag) => Mock.of<SimplifiedTag>({ tag }))}
selectedServer={Mock.all<SelectedServer>()}
currentOrder={{}}
orderByColumn={() => orderByColumn}