-
-
Notifications
You must be signed in to change notification settings - Fork 5.3k
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
Fix Datagrid row does not appear clickable although it is #10160
Conversation
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
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.
Because this test is made to please typescript, who complains on the following line that row may be undefined when trying to access the row classList
. It works with my test, not with expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
fireEvent.click(screen.getByText('hello')); | ||
const cell = screen.getByText('hello'); | ||
const row = cell.closest('tr'); | ||
if (!row) { |
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.
Why not use expect(row).toBeDefined();
Closes #10155