-
Notifications
You must be signed in to change notification settings - Fork 175
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat(app): extend SectionList component for Generic Step Screen #8513
Conversation
Codecov Report
@@ Coverage Diff @@
## edge #8513 +/- ##
==========================================
+ Coverage 74.29% 74.31% +0.01%
==========================================
Files 1693 1693
Lines 45557 45568 +11
Branches 4634 4639 +5
==========================================
+ Hits 33848 33865 +17
+ Misses 10907 10901 -6
Partials 802 802
Flags with carried forward coverage won't be shown. Click here to find out more.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice @jerader, this looks great! and WOW this is 100% covered by tests, you deserve a ⭐
Just left a few nits and comments about variable naming that might make what's going on a bit clearer.
import type { LabwarePositionCheckStep } from './types' | ||
import { useIntroInfo } from './hooks' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: the type import should go last
export const GenericStepScreen = ( | ||
export function GenericStepScreen( |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
how come this got changed from a function expression to a function declaration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
oh this is outdated now, ignore! 😄
completedSections != null && completedSections.includes(section) | ||
let iconBackgroundColor = C_DISABLED | ||
if (section === currentSection) { | ||
iconBackgroundColor = '#00c3e6' |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use C_SELECTED_DARK
here instead of the string literal?
backgroundColor={C_NEAR_WHITE} | ||
> | ||
{sections.map((section, index) => { | ||
const sectionTextOrBackgroundColor = |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename sectionTextOrBackgroundColor
to sectionTextColor
?
while it's being used to inform the Box
element's backgroundColor
, it's really being used by the Text
element as it's color
attribute
: C_DARK_GRAY | ||
const isCompleted = | ||
completedSections != null && completedSections.includes(section) | ||
let iconBackgroundColor = C_DISABLED |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we rename iconBackgroundColor
to backgroundColor
? this variable is being used whether or not we render an icon
}) | ||
it('renders LabwarePositionCheckStepDetail component', () => { | ||
const { getByText } = render(props) | ||
expect(getByText('Mock Labware Position Check Step Detail')).toBeTruthy() | ||
}) | ||
it('renders GenericStepScreenNav component', () => { | ||
const { getByText } = render(props) | ||
expect(getByText('Mock SectionList')).toBeTruthy() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this can be replaced with just getByText('Mock SectionList')
const PICKUP_TIP_LABWARE_ID = 'PICKUP_TIP_LABWARE_ID' | ||
const PRIMARY_PIPETTE_ID = 'PRIMARY_PIPETTE_ID' | ||
const mockLabwarePositionCheckStepTipRack = { | ||
const MOCK_SECTION = ['PRIMARY_PIPETTE_TIPRACKS' as Section] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
since this variable represents multiple sections, can we call it MOCK_SECTIONS
(plural)?
}) | ||
it('renders a 2 step Nav with 1 pipette', () => { | ||
const { getByText } = render(props) | ||
expect(getByText('1')).toHaveStyle('backgroundColor: #00c3e6') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
can we use the C_SELECTED_DARK
variable here? that way if we ever change color palettes we wont have to update all of our tests again 😄
Overview
closes #8500
Changelog
SectionList
and create testPositionCheckNav
toSectionList
Review requests
SectionList
to make sure it has all the AC in the ticketRisk assessment
low, behind ff