mirror of
https://github.com/apache/superset.git
synced 2026-05-12 11:25:56 +00:00
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:
@@ -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', () => {
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user