Skip to content

Commit

Permalink
fix(odd): fix typo Skelton -> Skeleton (#12451)
Browse files Browse the repository at this point in the history
fix typo Skelton -> Skeleton
  • Loading branch information
koji authored Apr 10, 2023
1 parent 96dd5ca commit c0f63bd
Show file tree
Hide file tree
Showing 5 changed files with 21 additions and 19 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,13 @@ import type { ScreenOption } from '../../../pages/OnDeviceDisplay/RunningProtoco
const CURRENT_RUNNING_PROTOCOL_COMMAND_SIZE = '99rem' // CurrentRunningProtocolCommand screen
const RUNNING_PROTOCOL_COMMAND_LIST_SIZE = '389rem' // RunningProtocolCommandList screen

interface RunningProtocolSkeltonProps {
interface RunningProtocolSkeletonProps {
currentOption: ScreenOption
}

export function RunningProtocolSkelton({
export function RunningProtocolSkeleton({
currentOption,
}: RunningProtocolSkeltonProps): JSX.Element {
}: RunningProtocolSkeletonProps): JSX.Element {
return (
<>
{currentOption === 'CurrentRunningProtocolCommand' ? (
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,16 @@ import * as React from 'react'

import { renderWithProviders } from '@opentrons/components'

import { RunningProtocolSkelton } from '../RunningProtocolSkelton'
import { RunningProtocolSkeleton } from '../RunningProtocolSkeleton'

const render = (props: React.ComponentProps<typeof RunningProtocolSkelton>) => {
return renderWithProviders(<RunningProtocolSkelton {...props} />)
const render = (
props: React.ComponentProps<typeof RunningProtocolSkeleton>
) => {
return renderWithProviders(<RunningProtocolSkeleton {...props} />)
}

describe('RunningProtocolSkelton', () => {
let props: React.ComponentProps<typeof RunningProtocolSkelton>
describe('RunningProtocolSkeleton', () => {
let props: React.ComponentProps<typeof RunningProtocolSkeleton>

beforeEach(() => {
props = {
Expand All @@ -22,7 +24,7 @@ describe('RunningProtocolSkelton', () => {
const skeletons = getAllByTestId('Skeleton')
const buttons = getAllByRole('button')
expect(buttons.length).toBe(2)
// Note Skelton component checks width and height so here just check the number of skeltons and background-size
// Note Skeleton component checks width and height so here just check the number of skeletons and background-size
expect(skeletons.length).toBe(4)
expect(skeletons[0]).toHaveStyle('animation: shimmer 2s infinite linear')
expect(skeletons[0]).toHaveStyle(`background-size: 99rem`)
Expand Down
2 changes: 1 addition & 1 deletion app/src/organisms/OnDeviceDisplay/RunningProtocol/index.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export * from './CurrentRunningProtocolCommand'
export * from './RunningProtocolCommandList'
export * from './RunningProtocolSkelton'
export * from './RunningProtocolSkeleton'
4 changes: 2 additions & 2 deletions app/src/pages/OnDeviceDisplay/RunningProtocol.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ import {
import {
CurrentRunningProtocolCommand,
RunningProtocolCommandList,
RunningProtocolSkelton,
RunningProtocolSkeleton,
} from '../../organisms/OnDeviceDisplay/RunningProtocol'
import { useTrackProtocolRunEvent } from '../../organisms/Devices/hooks'

Expand Down Expand Up @@ -148,7 +148,7 @@ export function RunningProtocol(): JSX.Element {
/>
)
) : (
<RunningProtocolSkelton currentOption={currentOption} />
<RunningProtocolSkeleton currentOption={currentOption} />
)}
<Flex
marginTop="2rem"
Expand Down
14 changes: 7 additions & 7 deletions app/src/pages/OnDeviceDisplay/__tests__/RunningProtocol.test.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import { mockRobotSideAnalysis } from '../../../organisms/CommandText/__fixtures
import {
CurrentRunningProtocolCommand,
RunningProtocolCommandList,
RunningProtocolSkelton,
RunningProtocolSkeleton,
} from '../../../organisms/OnDeviceDisplay/RunningProtocol'
import {
useRunStatus,
Expand Down Expand Up @@ -67,8 +67,8 @@ const mockCurrentRunningProtocolCommand = CurrentRunningProtocolCommand as jest.
const mockRunningProtocolCommandList = RunningProtocolCommandList as jest.MockedFunction<
typeof RunningProtocolCommandList
>
const mockRunningProtocolSkelton = RunningProtocolSkelton as jest.MockedFunction<
typeof RunningProtocolSkelton
const mockRunningProtocolSkeleton = RunningProtocolSkeleton as jest.MockedFunction<
typeof RunningProtocolSkeleton
>

const RUN_ID = 'run_id'
Expand Down Expand Up @@ -150,8 +150,8 @@ describe('RunningProtocol', () => {
mockRunningProtocolCommandList.mockReturnValue(
<div>mock RunningProtocolCommandList</div>
)
mockRunningProtocolSkelton.mockReturnValue(
<div>mock RunningProtocolSkelton</div>
mockRunningProtocolSkeleton.mockReturnValue(
<div>mock RunningProtocolSkeleton</div>
)
})

Expand All @@ -160,12 +160,12 @@ describe('RunningProtocol', () => {
resetAllWhenMocks()
})

it('should render Skelton when robotSideAnalysis does not have data', () => {
it('should render Skeleton when robotSideAnalysis does not have data', () => {
when(mockUseMostRecentCompletedAnalysis)
.calledWith(RUN_ID)
.mockReturnValue(null)
const [{ getByText }] = render(`/protocols/${RUN_ID}/run`)
getByText('mock RunningProtocolSkelton')
getByText('mock RunningProtocolSkeleton')
})

it('should render CurrentRunningProtocolCommand when loaded the data', () => {
Expand Down

0 comments on commit c0f63bd

Please sign in to comment.