-
Notifications
You must be signed in to change notification settings - Fork 3
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: add an argument to expand moreInfo of an input #441
Conversation
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.
I know it's simple change but maybe its worth to add some simple test just to test if it really skips the click? smth with pytest.raises etc.? What do you think?
@@ -487,15 +487,19 @@ def get_count_number(self): | |||
row_count = self.get_count_title() | |||
return int(re.search(r"\d+", row_count).group()) | |||
|
|||
def get_more_info(self, name, cancel=True): | |||
def get_more_info(self, name, cancel=True, expand_row=True): |
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.
I don't get the point of this flag. It seems like leaking abstraction for the method that should return the content of _More Info`. Why should caller of this method know about if it is open or close?
Here is my suggestion
- check if the row is expanded with attribute
aria-expanded
. - if the value is
'false'
, click on the arrow - if there is a
Loading
inside, wait it disappear (in case the custom row is used), it loads in runtime
Here is how I would write in UI unit tests
const arrow = within(inputRow).getByRole('cell', { name: /expandable/i });
const isExpanded = arrow.getAttribute('aria-expanded');
if (isExpanded === 'false') {
await userEvent.click(arrow);
}
await waitFor(() => expect(arrow.getAttribute('aria-expanded')).not.toBe('false'));
const loading = screen.queryByText('Loading...');
if (loading) {
await waitForElementToBeRemoved(loading);
}
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.
We added the flag to ensure that the moreInfo
section remains expanded based on the use case. This allows any changes made to the input's row to be immediately reflected in the custom row section without collapsing and re-expanding the moreInfo
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.
I have written the unit test case in my PR itself, so we don't need this change in smartx. Hence, we can close this PR.
Added unit test cases for |
Test case is covered in the PR PR-1445 so don't need this smartx changes. Hence, closing this PR. |
Added an argument in
get_more_info
function which specifies whether to click on the arrow that display more info about an input.This is required in a scenario as described in splunk/addonfactory-ucc-generator#1410.