Skip to content

Commit

Permalink
typos
Browse files Browse the repository at this point in the history
  • Loading branch information
zhaoyongjie committed Feb 7, 2022
1 parent c6dc69c commit e4e1eca
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 12 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ import InfoTooltipWithTrigger from './InfoTooltipWithTrigger';
import { ColumnTypeLabel } from './ColumnTypeLabel';
import CertifiedIconWithTooltip from './CertifiedIconWithTooltip';
import Tooltip from './Tooltip';
import { getMeticTooltipNode } from './labelUtils';
import { getMetricTooltipNode } from './labelUtils';

const FlexRowContainer = styled.div`
align-items: center;
Expand Down Expand Up @@ -64,7 +64,7 @@ export function MetricOption({
const [tooltipText, setTooltipText] = useState<ReactNode>(metric.metric_name);

useEffect(() => {
setTooltipText(getMeticTooltipNode(metric, labelRef));
setTooltipText(getMetricTooltipNode(metric, labelRef));
}, [labelRef, metric]);

return (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ export const getColumnTooltipNode = (

type MetricType = Omit<Metric, 'id'> & { label?: string };

export const getMeticTooltipNode = (
export const getMetricTooltipNode = (
metric: MetricType,
labelRef?: React.RefObject<any>,
): ReactNode => {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ import React from 'react';
import {
getColumnLabelText,
getColumnTooltipNode,
getMeticTooltipNode,
getMetricTooltipNode,
} from '../../src/components/labelUtils';

test("should get column name when column doesn't have verbose_name", () => {
Expand Down Expand Up @@ -58,7 +58,7 @@ test('should get null as tooltip', () => {
).toBe(null);
});

test('should get column name as tooltip when it verbose name', () => {
test('should get column name and verbose name when it has a verbose name', () => {
const rvNode = (
<>
<div>column name: column name</div>
Expand Down Expand Up @@ -93,7 +93,7 @@ test('should get column name as tooltip if it overflowed', () => {
).toBe('column name: long long long long column name');
});

test('should get verbose name as tooltip if it overflowed', () => {
test('should get column name and verbose name as tooltip if it overflowed', () => {
const rvNode = (
<>
<div>column name: long long long long column name</div>
Expand All @@ -117,7 +117,7 @@ test('should get verbose name as tooltip if it overflowed', () => {
test('should get null as tooltip in metric', () => {
const ref = { current: { scrollWidth: 100, clientWidth: 100 } };
expect(
getMeticTooltipNode(
getMetricTooltipNode(
{
metric_name: 'count',
label: '',
Expand All @@ -128,7 +128,7 @@ test('should get null as tooltip in metric', () => {
).toBe(null);
});

test('should get metric name(sql alias) as tooltip in metric', () => {
test('should get metric name and verbose name as tooltip in metric', () => {
const rvNode = (
<>
<div>metric name: count</div>
Expand All @@ -138,7 +138,7 @@ test('should get metric name(sql alias) as tooltip in metric', () => {

const ref = { current: { scrollWidth: 100, clientWidth: 100 } };
expect(
getMeticTooltipNode(
getMetricTooltipNode(
{
metric_name: 'count',
label: 'count(*)',
Expand All @@ -149,7 +149,7 @@ test('should get metric name(sql alias) as tooltip in metric', () => {
).toStrictEqual(rvNode);
});

test('should get verbose name as tooltip in metric if it overflowed', () => {
test('should get metric name and verbose name in tooltip if it overflowed', () => {
const rvNode = (
<>
<div>metric name: count</div>
Expand All @@ -159,7 +159,7 @@ test('should get verbose name as tooltip in metric if it overflowed', () => {

const ref = { current: { scrollWidth: 200, clientWidth: 100 } };
expect(
getMeticTooltipNode(
getMetricTooltipNode(
{
metric_name: 'count',
label: '',
Expand All @@ -173,7 +173,7 @@ test('should get verbose name as tooltip in metric if it overflowed', () => {
test('should get label name as tooltip in metric if it overflowed', () => {
const ref = { current: { scrollWidth: 200, clientWidth: 100 } };
expect(
getMeticTooltipNode(
getMetricTooltipNode(
{
metric_name: 'count',
label: 'longlonglonglonglong metric label',
Expand Down

0 comments on commit e4e1eca

Please sign in to comment.