-
Notifications
You must be signed in to change notification settings - Fork 85
feat(slash): add test for table component #1395
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
base: main
Are you sure you want to change the base?
Conversation
pplancq
left a comment
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.
Il faudrait que les tests et exemple soit en anglais
| </Table>, | ||
| ); | ||
|
|
||
| const table = container.querySelector("table"); |
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.
getByRole('table') normalement c'est bon
| describe("Composants de la table", () => { | ||
| it("devrait rendre un tableau avec la classe correcte", () => { | ||
| const { container } = render( | ||
| <Table data-testid="table"> |
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.
pourquoi mettre un data-testid s'il n'est pas utiliser dans le test
| }); | ||
|
|
||
| it("devrait accepter et appliquer une classe custom", () => { | ||
| const { container } = render(<Table className="custom-class">{}</Table>); |
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.
| const { container } = render(<Table className="custom-class">{}</Table>); | |
| const { container } = render(<Table className="custom-class"/>); |
| expect(table?.className).toContain("af-table"); | ||
| expect(table?.className).toContain("mod"); |
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.
| expect(table?.className).toContain("af-table"); | |
| expect(table?.className).toContain("mod"); | |
| expect(table).toHaveClass("af-table af-table--mod"); |
| </Table.THead>, | ||
| ); | ||
|
|
||
| const thead = container.querySelector("thead"); |
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.
il me semble que getByRole('rowgroup') devrait fonctionner.
| <Table.Td data-test-id="td-test" aria-label="label" />, | ||
| ); | ||
|
|
||
| const td = container.querySelector("td"); |
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.
il me semble que getByRole('cell') devrait fonctionner
Feat #698
The Slash Table component has no test, so his coverage is at 0%
The component should be covered.
https://sonarcloud.io/component_measures?metric=coverage&selected=AxaFrance_design-system%3Aslash%2Freact%2Fsrc%2FTable&id=AxaFrance_design-system
Close #698