-
Notifications
You must be signed in to change notification settings - Fork 4.5k
TESTING EXTERNAL SCRIPT: external merge request from Contributor #37007
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
Changes from all commits
3d47dbc
b586477
105b64d
7a5f577
51cee7d
e3215ac
b121f98
1533846
9766ed4
0282f02
2ce4bf3
c676015
833aecc
2cfa618
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change | ||||||||||||||||||||||||||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
|
|
@@ -44,6 +44,10 @@ const ResultsCount = styled.div` | |||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--ads-v2-color-fg); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| `; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| const ErrorText = styled(Text)` | ||||||||||||||||||||||||||||||||||||||||||||||||||
| color: var(--ads-v2-colors-action-error-label-default-fg); | ||||||||||||||||||||||||||||||||||||||||||||||||||
| `; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| interface QueryDebuggerTabsProps { | ||||||||||||||||||||||||||||||||||||||||||||||||||
| actionSource: SourceEntity; | ||||||||||||||||||||||||||||||||||||||||||||||||||
| currentActionConfig?: Action; | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
@@ -274,11 +278,15 @@ function QueryDebuggerTabs({ | |||||||||||||||||||||||||||||||||||||||||||||||||
| > | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {output && !!output.length && ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <ResultsCount> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <Text type={TextType.P3}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <Text data-testid="result-text" type={TextType.P3}> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| Result: | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <Text type={TextType.H5}>{` ${output.length} Record${ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| output.length > 1 ? "s" : "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }`}</Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| {actionResponse?.isExecutionSuccess ? ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <Text type={TextType.H5}>{` ${output.length} Record${ | ||||||||||||||||||||||||||||||||||||||||||||||||||
| output.length > 1 ? "s" : "" | ||||||||||||||||||||||||||||||||||||||||||||||||||
| }`}</Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| ) : ( | ||||||||||||||||||||||||||||||||||||||||||||||||||
| <ErrorText type={TextType.H5}>{" Error"}</ErrorText> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
Comment on lines
+281
to
+289
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. 🛠️ Refactor suggestion Improve readability and accessibility of the results display. The current implementation could be simplified and made more accessible. Consider this refactor: - <Text data-testid="result-text" type={TextType.P3}>
- Result:
- {actionResponse?.isExecutionSuccess ? (
- <Text type={TextType.H5}>{` ${output.length} Record${
- output.length > 1 ? "s" : ""
- }`}</Text>
- ) : (
- <ErrorText type={TextType.H5}>{" Error"}</ErrorText>
- )}
- </Text>
+ <Text
+ data-testid="result-text"
+ type={TextType.P3}
+ role="status"
+ aria-live="polite"
+ >
+ {actionResponse?.isExecutionSuccess ? (
+ `Result: ${output.length} Record${output.length !== 1 ? 's' : ''}`
+ ) : (
+ 'Result: Error'
+ )}
+ </Text>Changes:
📝 Committable suggestion
Suggested change
|
||||||||||||||||||||||||||||||||||||||||||||||||||
| </Text> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| </ResultsCount> | ||||||||||||||||||||||||||||||||||||||||||||||||||
| )} | ||||||||||||||||||||||||||||||||||||||||||||||||||
|
|
||||||||||||||||||||||||||||||||||||||||||||||||||
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.
🛠️ Refactor suggestion
Consider enhancing test isolation.
While the test implementation is correct, consider moving the common render setup to a helper function to reduce duplication and improve maintainability.