Skip to content

Commit

Permalink
Merge branch 'feat_add-resizeable-sidebar' of https://github.com/Open…
Browse files Browse the repository at this point in the history
…trons/opentrons into feat_add-resizeable-sidebar
  • Loading branch information
koji committed Dec 16, 2024
2 parents ea625d2 + 7b99baf commit ad6b69e
Show file tree
Hide file tree
Showing 4 changed files with 11 additions and 14 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -77,8 +77,6 @@ export function DraggableSidebar({
const SidebarContainer = styled(Box)`
display: ${DISPLAY_FLEX};
flex-direction: ${DIRECTION_COLUMN};
/* background-color: #f4f4f4; */
background-color: #ff0000;
border-right: 1px solid #ccc;
position: relative;
overflow: hidden;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ describe('TimelineToolbox', () => {
vi.mocked(PresavedStep).mockReturnValue(<div>mock PresavedStep</div>)
vi.mocked(AddStepButton).mockReturnValue(<div>mock AddStepButton</div>)
})

it('renders 2 terminal item steps, a draggable step and presaved step with toolbox title', () => {
render(props)
screen.getByText('Timeline')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,16 @@ import { screen } from '@testing-library/react'

import { i18n } from '../../../../assets/localization'
import { renderWithProviders } from '../../../../__testing-utils__'
import { TimelineToolbox } from '../Timeline'
import { DraggableSidebar } from '../DraggableSidebar'

import type { ComponentProps } from 'react'

vi.mock('../Timeline')
vi.mock('../../../../step-forms/selectors')
vi.mock('../../../../ui/steps/selectors')
// vi.mock('../Timeline', async importOriginal => {
// const actual = await importOriginal<typeof TimelineToolbox>()
// return {
// ...actual,
// TimelineToolbox: () => <div>mock TimelineToolbox</div>,
// }
// })
vi.mock('../../../../feature-flags/selectors')
vi.mock('../Timeline/DraggableSteps')
vi.mock('../Timeline/PresavedStep')
vi.mock('../Timeline/AddStepButton')

const mockSetTargetWidth = vi.fn()

Expand All @@ -33,11 +28,14 @@ describe('DraggableSidebar', () => {
props = {
setTargetWidth: mockSetTargetWidth,
}
vi.mocked(TimelineToolbox).mockReturnValue(<div>mock TimelineToolbox</div>)
})

it('renders mock TimelineToolbox', () => {
it('renders initial timeline toolbox', () => {
render(props)
screen.getByText('mock TimelineToolbox')
screen.getByText('Timeline')
screen.getByText('Starting deck')
screen.getByText('Ending deck')
})

// ToDo (kk: 2024/12/12): Add more tests
})

0 comments on commit ad6b69e

Please sign in to comment.