Skip to content

Commit

Permalink
Merge pull request #406 from bartoval/fix_ts_errors
Browse files Browse the repository at this point in the history
fix(General): 🐞 Remove typescript compiler errors
  • Loading branch information
bartoval authored Apr 30, 2024
2 parents 2e79e8b + 3c5c46e commit e4742a4
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 10 deletions.
2 changes: 1 addition & 1 deletion src/core/components/SkChartArea/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,7 @@ const SkChartArea: FC<SkChartAreaProps> = function ({
labelComponent={
<ChartLegendTooltip
legendData={legendData}
title={(datum) => `${formatX(datum.x, startDate)}`}
title={(datum: skAxisXY) => `${formatX(datum.x, startDate)}`}
cornerRadius={5}
flyoutStyle={{
fillOpacity: 0.75
Expand Down
2 changes: 1 addition & 1 deletion src/core/components/SkTable/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ const SkTable = function <T>({
<Tr>
{skColumns.map(({ name, prop, columnDescription, isStickyColumn, modifier }, index) => (
<Th
screenReaderText={!name ? 'Action Column' : undefined}
aria-label={!name ? 'Action Column' : undefined}
colSpan={1}
key={name}
modifier={modifier}
Expand Down
14 changes: 7 additions & 7 deletions src/pages/Topology/__tests__/TopologyToasts.spec.tsx
Original file line number Diff line number Diff line change
@@ -1,20 +1,20 @@
import { createRef } from 'react';

import { render, waitFor } from '@testing-library/react';
import { act, render } from '@testing-library/react';
import eventUser from '@testing-library/user-event';

import AlertToast, { ToastExposeMethods } from '../components/TopologyToasts';

describe('AlertToast', () => {
it('should add a new alert when addMessage is called', async () => {
it('should add a new alert when addMessage is called', () => {
const toastRef = createRef<ToastExposeMethods>();
const { findByText } = render(<AlertToast ref={toastRef} />);
const { getByText } = render(<AlertToast ref={toastRef} />);

const addMessage = toastRef.current?.addMessage;
expect(addMessage).toBeDefined();

addMessage!('This is a toast message!');
expect(await findByText('This is a toast message!')).toBeInTheDocument();
act(() => addMessage!('This is a toast message!'));
expect(getByText('This is a toast message!')).toBeInTheDocument();
});

it('should remove an alert when the close button is clicked', async () => {
Expand All @@ -24,8 +24,8 @@ describe('AlertToast', () => {
const addMessage = toastRef.current?.addMessage;
expect(addMessage).toBeDefined();

addMessage!('This is a toast message!');
const toast = await waitFor(() => getByTestId(`sk-toast-0`));
act(() => addMessage!('This is a toast message!'));
const toast = getByTestId(`sk-toast-0`);

await eventUser.click(toast.querySelector('button') as HTMLButtonElement);
expect(toast).not.toBeInTheDocument();
Expand Down
2 changes: 1 addition & 1 deletion src/pages/shared/Metrics/components/TrafficCharts.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const TrafficCharts: FC<{ byteRateData: ByteRateMetrics }> = memo(({ byteRateDat
<Table borders={false} variant="compact">
<Thead noWrap>
<Tr>
<Th screenReaderText="metric" />
<Th aria-label="metric" />
<Th>{MetricsLabels.ByteRateMaxCol}</Th>
<Th>{MetricsLabels.ByteRateAvgCol}</Th>
<Th>{MetricsLabels.ByteRateCurrentCol}</Th>
Expand Down

0 comments on commit e4742a4

Please sign in to comment.