chore: fix explore pills (#19866)

* chore: fix explore pills

* fix tests

* address comments

* add test and remove redundant div

* switch to dark text
This commit is contained in:
Ville Brofeldt
2022-04-28 10:28:47 +03:00
committed by GitHub
parent e4fca89217
commit 3d2fec9604
12 changed files with 133 additions and 97 deletions

View File

@@ -20,9 +20,14 @@ import React from 'react';
import { render, screen } from 'spec/helpers/testing-library';
import { RowCount } from '.';
test('Render a RowCount', () => {
test('Render a RowCount with a single row', () => {
render(<RowCount data={[{}]} loading={false} />);
expect(screen.getByText('1 row')).toBeInTheDocument();
});
test('Render a RowCount with multiple rows', () => {
render(<RowCount data={[{}, {}, {}]} loading={false} />);
expect(screen.getByText('3 rows retrieved')).toBeInTheDocument();
expect(screen.getByText('3 rows')).toBeInTheDocument();
});
test('Render a RowCount on loading', () => {

View File

@@ -127,13 +127,7 @@ export const RowCount = ({
}: {
data?: Record<string, any>[];
loading: boolean;
}) => (
<RowCountLabel
rowcount={data?.length ?? 0}
loading={loading}
suffix={t('rows retrieved')}
/>
);
}) => <RowCountLabel rowcount={data?.length ?? 0} loading={loading} />;
enum FormatPickerValue {
Formatted,