-
Notifications
You must be signed in to change notification settings - Fork 311
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
chore(content-picker): migrate ItemList to TypeScript and RTL tests #3832
Conversation
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
⚙️ Control Options:
|
d48f503
to
ccc41f9
Compare
ccc41f9
to
3d101cc
Compare
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 is an empty file and it deleted the original js file
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.
WOAH
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.
are we able to add before / after screenshots or have devin confirm that there are no visual changes?
width={width} | ||
height={height} | ||
headerHeight={0} | ||
aria-label="Content Picker Items" |
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 should be translated
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.
tests seem pretty good
selected, | ||
}); | ||
|
||
describe('isRowSelectable()', () => { |
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 function explicitly returns a boolean so the expects should probably toBe(true)
/ toBe(false)
rather than toBeTruthy()
or toBeFalsy()
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.
pretty good tests again
// Verify ShareAccessSelect is rendered | ||
const shareAccessWrapper = screen.getByTestId('bcp-shared-access-select'); | ||
expect(shareAccessWrapper).toBeInTheDocument(); | ||
|
||
// Verify ShareAccessSelect component is rendered | ||
expect(shareAccessWrapper.children.length).toBeGreaterThan(0); |
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.
what
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.
seems ShareAccessSelect
always has at least one child?
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.
nvm i see what happened, it added wrapping divs around the original implementation
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.
which i don't think is great
label={name as string} | ||
name={name as string} |
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 should already be type string?
aria-label={name} | ||
onChange={() => onItemSelect(rowData)} | ||
value={name} | ||
{...{ [isRadio ? 'isSelected' : 'isChecked']: selected, 'aria-label': name }} |
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.
aria-label is already listed as a separate prop above
<div data-testid="bcp-share-access-loading"> | ||
<LoadingIndicator className="bcp-share-access-loading" /> | ||
</div> | ||
) : ( | ||
<div data-testid="bcp-shared-access-select"> | ||
<ShareAccessSelect | ||
canSetShareAccess={canSetShareAccess} | ||
className="bcp-shared-access-select" | ||
item={rowData} | ||
onChange={onChange} | ||
/> | ||
</div> |
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.
it added these wrapping divs specifically for the test. this could potentially mess up styling and layout
Closing due to inactivity. |
Description
Convert ItemList component and its associated files from JavaScript (Flow) to TypeScript, and migrate tests to use react-testing-library.
Changes
Testing
Link to Devin run: https://app.devin.ai/sessions/b29c0a55998241bca7b6d9466b997eb5