feat: #218 v5 Table Container and Table Toolbar#234
Conversation
Coverage summary from CodacySee diff coverage on Codacy
Coverage variation details
Coverage variation is the difference between the coverage for the head and common ancestor commits of the pull request branch: Diff coverage details
Diff coverage is the percentage of lines that are covered by tests out of the coverable lines that the pull request added or modified: See your quality gate settings Change summary preferencesCodacy stopped sending the deprecated coverage status on June 5th, 2024. Learn more Footnotes
|
| <TableToolbar | ||
| description="125 Properties" | ||
| actions={ | ||
| <Menu> |
There was a problem hiding this comment.
@kurtdoherty
question: Since this prop accepts a ReactNode, is there a standard approach we should follow for test cases? Specifically, should we replicate the exact children that will be used in production, or would using a simple component, such as a Button, suffice to meet the test case requirements?
There was a problem hiding this comment.
For unit tests, I think it's fine to use fake text for any ReactNode props. Composing in actual atoms like TableToolbar and Menu will result in our subject's snapshot (in this case, TableContainer) capturing the implementation detail of those other components. When those other components are then changed, we'll see test failures here because the snapshot content won't match, which is not something we want.
kurtdoherty
left a comment
There was a problem hiding this comment.
Thanks @ksolanki7, looks good 👏 Two nice and simple components 💪
issue: One main problem I've noticed here is the folder and file naming. You seem to have used camel case where the rest of the repo using snake/hyphen case. Can you please update all the files and folders to be consistent with the rest of the repo? 🙏
|
|
||
| export const ElSkeleton = styled.span` | ||
| display: inline-block; | ||
| display: flex; |
There was a problem hiding this comment.
question: what was the motivation behind this change?
There was a problem hiding this comment.
answer: I was facing challenges using display: inline-block for the parent element, which did not align the child element in the center. So, I updated the display property to flex.
FYI: Figma does not have the display property, which I used to support the child element alignment in the parent container.
| <TableToolbar | ||
| description="125 Properties" | ||
| actions={ | ||
| <Menu> |
There was a problem hiding this comment.
For unit tests, I think it's fine to use fake text for any ReactNode props. Composing in actual atoms like TableToolbar and Menu will result in our subject's snapshot (in this case, TableContainer) capturing the implementation detail of those other components. When those other components are then changed, we'll see test failures here because the snapshot content won't match, which is not something we want.
|
|
||
| export const ElTableContainer = styled.div` | ||
| gap: 0px; | ||
| background: var(--fill-white); |
There was a problem hiding this comment.
question: Is this strictly needed? Do we care what the background of this container is?
There was a problem hiding this comment.
answer: I copied this across from Figma, I'll double-check with Andrei if it's a requirement. If not, I will remove it.
| export const ElTableToolbarDescription = styled.div` | ||
| font-family: var(--font-family); | ||
| font-size: var(--font-size-sm); | ||
| font-weight: 400; |
There was a problem hiding this comment.
issue: I think we have CSS variables for font weights that we should be using. I can certainly see the variables defined in Figma.
There was a problem hiding this comment.
As discussed, the font-weight variables do not work and need some fixes. I will update it once the fix is in place.
Description
Details of Table atoms completed in this PR:
Additional Changes: