-
Notifications
You must be signed in to change notification settings - Fork 179
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(app,components): fix module controls no module connected case
Connect modules to see controls doesn't align with the design. This PR fixes. The component is the same as NoParameters component so I rename and add a new prop to use only one component. close AUTH-264
- Loading branch information
Showing
8 changed files
with
81 additions
and
59 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
32 changes: 0 additions & 32 deletions
32
components/src/molecules/ParametersTable/__tests__/NoParameters.test.tsx
This file was deleted.
Oops, something went wrong.
48 changes: 48 additions & 0 deletions
48
components/src/molecules/ParametersTable/__tests__/ProtocolRunEmptyState.test.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
import * as React from 'react' | ||
import { screen } from '@testing-library/react' | ||
import { describe, it, expect, beforeEach } from 'vitest' | ||
|
||
import { renderWithProviders } from '../../../testing/utils' | ||
import { BORDERS, COLORS } from '../../../helix-design-system' | ||
import { ProtocolRunEmptyState } from '../ProtocolRunEmptyState' | ||
|
||
const render = (props: React.ComponentProps<typeof ProtocolRunEmptyState>) => { | ||
return renderWithProviders(<ProtocolRunEmptyState {...props} />) | ||
} | ||
|
||
describe('NoParameters', () => { | ||
let props: React.ComponentProps<typeof ProtocolRunEmptyState> | ||
|
||
beforeEach(() => { | ||
props = { | ||
contentType: 'parameters', | ||
} | ||
}) | ||
it('should render text and icon with proper color - parameters', () => { | ||
render(props) | ||
screen.getByLabelText('alert') | ||
screen.getByText('No parameters specified in this protocol') | ||
}) | ||
|
||
it('should render text and icon with proper color - module controls', () => { | ||
props = { | ||
contentType: 'moduleControls', | ||
} | ||
render(props) | ||
screen.getByLabelText('alert') | ||
screen.getByText('Connect modules to see controls') | ||
}) | ||
|
||
it('should have proper styles', () => { | ||
render(props) | ||
expect(screen.getByTestId('NoRunTimeParameter')).toHaveStyle( | ||
`background-color: ${COLORS.grey30}` | ||
) | ||
expect(screen.getByTestId('NoRunTimeParameter')).toHaveStyle( | ||
`border-radius: ${BORDERS.borderRadius8}` | ||
) | ||
expect(screen.getByLabelText('alert')).toHaveStyle( | ||
`color: ${COLORS.grey60}` | ||
) | ||
}) | ||
}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,4 @@ | ||
export * from './LocationIcon' | ||
export * from './RoundTab' | ||
export * from './ParametersTable' | ||
export * from './ParametersTable/NoParameters' | ||
export * from './ParametersTable/ProtocolRunEmptyState' |