Skip to content

Commit 8e34e92

Browse files
committed
test and lint fixes
1 parent 34d5740 commit 8e34e92

14 files changed

Lines changed: 24 additions & 33 deletions

File tree

protocol-visualization/src/__testing-utils__/index.tsx

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,6 @@ import type { RenderResult } from '@testing-library/react'
88
const testI18n = i18n.createInstance()
99
testI18n.use(initReactI18next).init({ lng: 'en', resources: {} })
1010

11-
// export function renderWithProviders(ui: React.ReactElement): RenderResult {
12-
// return render(<I18nextProvider i18n={testI18n}>{ui}</I18nextProvider>)
13-
// }
1411
interface RenderOptions {
1512
i18nInstance?: typeof i18n
1613
}

protocol-visualization/src/__tests__/index.test.ts

Lines changed: 0 additions & 9 deletions
This file was deleted.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import protocol_visualization from './protocol_visualization.json'
2+
3+
export const en = { protocol_visualization }

protocol-visualization/src/locale/en/protocol_visualization.json renamed to protocol-visualization/src/assets/localization/en/protocol_visualization.json

File renamed without changes.
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import { en } from './en'
2+
3+
export const resources = { en }

protocol-visualization/src/i18n.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,18 @@
11
import { initReactI18next } from 'react-i18next'
22
import i18next from 'i18next'
33

4-
import en from './locale/en/protocol_visualization.json'
4+
import { resources } from './assets/localization'
55

66
export const i18n = i18next.createInstance()
7-
i18n
8-
.use(initReactI18next)
9-
.init({ lng: 'en', resources: { en: { protocol_visualization: en } } })
7+
i18n.use(initReactI18next).init({ lng: 'en', resources })
108

11-
export function registerProtocolVisualizationI18n(i18nInstance: typeof i18n): void {
9+
export function registerProtocolVisualizationI18n(
10+
i18nInstance: typeof i18n
11+
): void {
1212
i18nInstance.addResourceBundle(
1313
'en',
1414
'protocol_visualization',
15-
en,
15+
resources,
1616
true,
1717
false
1818
)

protocol-visualization/src/organisms/DeckView/DeckViewLabwareCommandSummaries.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ import { LabwareCommandSummary } from './LabwareCommandSummary'
1313

1414
import type { DeckDefinition, RunTimeCommand } from '@opentrons/shared-data'
1515
import type { InvariantContext, RobotState } from '@opentrons/step-generation'
16-
import type { LabwareEntityExtended } from '../../../../organisms/Desktop/ProtocolVisualization/DeckView'
16+
import type { LabwareEntityExtended } from './index'
1717

1818
interface DeckViewLabwareCommandSummariesProps {
1919
robotState: RobotState

protocol-visualization/src/organisms/DeckView/DeckViewStacker.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ import type {
2525
RunTimeCommand,
2626
} from '@opentrons/shared-data'
2727
import type { InvariantContext, RobotState } from '@opentrons/step-generation'
28-
import type { LabwareEntityExtended } from '../../../../organisms/Desktop/ProtocolVisualization/DeckView'
28+
import type { LabwareEntityExtended } from './index'
2929

3030
const STACKER_X_OFFSET = 17
3131
const STACKER_POSITION_OFFSET = 178

protocol-visualization/src/organisms/SecondWindow/LabwareSlot/__tests__/LabwareSlot.test.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { beforeEach, describe, expect, it, vi } from 'vitest'
33

44
import { fixture96Plate } from '@opentrons/shared-data'
55

6-
import { renderWithProviders } from "../../../../../../../../../../app/__testing-utils__"
7-
import { i18n } from "../../../../../../../../../../app/i18n"
8-
96
import { LabwareSlot } from '..'
7+
import { renderWithProviders } from '../../../../__testing-utils__'
8+
import { i18n } from '../../../../i18n'
109

1110
import type { ComponentProps } from 'react'
1211
import type * as OpentronsComponents from '@opentrons/components'

protocol-visualization/src/organisms/SecondWindow/TipDisposalSlot/__tests__/TipDisposalSlot.test.tsx

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,10 +3,9 @@ import { beforeEach, describe, it } from 'vitest'
33

44
import { CLEAN, EMPTY } from '@opentrons/step-generation'
55

6-
import { renderWithProviders } from "../../../../../../../../../../app/__testing-utils__"
7-
import { i18n } from "../../../../../../../../../../app/i18n"
8-
9-
import { TipDisposalSlot } from '..'
6+
import { renderWithProviders } from '../../../../__testing-utils__'
7+
import { i18n } from '../../../../i18n'
8+
import { TipDisposalSlot } from '../index'
109

1110
import type { ComponentProps } from 'react'
1211

0 commit comments

Comments
 (0)