codeant-ai-for-open-source[bot] commented on code in PR #44183:
URL: https://github.com/apache/superset/pull/44183#discussion_r3998704343
##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx:
##########
@@ -48,76 +48,84 @@ beforeEach(() => {
jest.clearAllMocks();
});
-test('always renders editors field', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('renders tags field with multiple tags when TaggingSystem feature is
enabled', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
render(<AccessSection {...defaultProps} />);
- expect(screen.getByTestId('dashboard-editors-field')).toBeInTheDocument();
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('does not render viewers field when EnableViewers is off', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('allows selecting multiple tags', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
- render(<AccessSection {...defaultProps} />);
+ const newTags = [
+ { id: 1, name: 'Important' },
+ { id: 2, name: 'Urgent' },
+ { id: 3, name: 'Review' },
+ ];
- expect(
- screen.queryByTestId('dashboard-viewers-field'),
- ).not.toBeInTheDocument();
+ render(<AccessSection {...defaultProps} tags={newTags} />);
+
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
Review Comment:
**Suggestion:** The multiple-selection test never opens the selector,
selects tags, or checks the change callback, so mode and selection regressions
pass. [incomplete implementation]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=f1ccd5a1a17f40c981148c73281219eb&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=f1ccd5a1a17f40c981148c73281219eb&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx
**Line:** 66:74
**Comment:**
*Incomplete Implementation: The multiple-selection test never opens the
selector, selects tags, or checks the change callback, so mode and selection
regressions pass.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ce2f934d32f08d59df6da438d5eb1517b9a2569b8b47b2829e1e5b07430dca25&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ce2f934d32f08d59df6da438d5eb1517b9a2569b8b47b2829e1e5b07430dca25&reaction=dislike'>๐</a>
##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx:
##########
@@ -48,76 +48,84 @@ beforeEach(() => {
jest.clearAllMocks();
});
-test('always renders editors field', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('renders tags field with multiple tags when TaggingSystem feature is
enabled', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
render(<AccessSection {...defaultProps} />);
- expect(screen.getByTestId('dashboard-editors-field')).toBeInTheDocument();
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('does not render viewers field when EnableViewers is off', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('allows selecting multiple tags', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
- render(<AccessSection {...defaultProps} />);
+ const newTags = [
+ { id: 1, name: 'Important' },
+ { id: 2, name: 'Urgent' },
+ { id: 3, name: 'Review' },
+ ];
- expect(
- screen.queryByTestId('dashboard-viewers-field'),
- ).not.toBeInTheDocument();
+ render(<AccessSection {...defaultProps} tags={newTags} />);
+
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('renders viewers field when EnableViewers is on', () => {
+test('shows selected tags in the tag selector', () => {
mockedIsFeatureEnabled.mockImplementation(
- (flag: any) => flag === FeatureFlag.EnableViewers,
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
);
- render(<AccessSection {...defaultProps} />);
+ const tags = [
+ { id: 1, name: 'Important' },
+ { id: 2, name: 'Urgent' },
+ ];
+
+ render(<AccessSection {...defaultProps} tags={tags} />);
- expect(screen.getByTestId('dashboard-editors-field')).toBeInTheDocument();
- expect(screen.getByTestId('dashboard-viewers-field')).toBeInTheDocument();
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
Review Comment:
**Suggestion:** The selected-tags test checks only the wrapper, so incorrect
tag ID or name mapping and missing selected values remain undetected.
[incomplete implementation]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=2c8c1e28b49141fe91b162419351dc99&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=2c8c1e28b49141fe91b162419351dc99&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx
**Line:** 82:89
**Comment:**
*Incomplete Implementation: The selected-tags test checks only the
wrapper, so incorrect tag ID or name mapping and missing selected values remain
undetected.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ff984945098212232b099b72c2664db5f4b7774c8fe96e7bd4084baf22bec879&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ff984945098212232b099b72c2664db5f4b7774c8fe96e7bd4084baf22bec879&reaction=dislike'>๐</a>
##########
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx:
##########
@@ -48,76 +48,84 @@ beforeEach(() => {
jest.clearAllMocks();
});
-test('always renders editors field', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('renders tags field with multiple tags when TaggingSystem feature is
enabled', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
render(<AccessSection {...defaultProps} />);
- expect(screen.getByTestId('dashboard-editors-field')).toBeInTheDocument();
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('does not render viewers field when EnableViewers is off', () => {
- mockedIsFeatureEnabled.mockReturnValue(false);
+test('allows selecting multiple tags', () => {
+ mockedIsFeatureEnabled.mockImplementation(
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
+ );
- render(<AccessSection {...defaultProps} />);
+ const newTags = [
+ { id: 1, name: 'Important' },
+ { id: 2, name: 'Urgent' },
+ { id: 3, name: 'Review' },
+ ];
- expect(
- screen.queryByTestId('dashboard-viewers-field'),
- ).not.toBeInTheDocument();
+ render(<AccessSection {...defaultProps} tags={newTags} />);
+
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('renders viewers field when EnableViewers is on', () => {
+test('shows selected tags in the tag selector', () => {
mockedIsFeatureEnabled.mockImplementation(
- (flag: any) => flag === FeatureFlag.EnableViewers,
+ (flag: any) => flag === FeatureFlag.TaggingSystem,
);
- render(<AccessSection {...defaultProps} />);
+ const tags = [
+ { id: 1, name: 'Important' },
+ { id: 2, name: 'Urgent' },
+ ];
+
+ render(<AccessSection {...defaultProps} tags={tags} />);
- expect(screen.getByTestId('dashboard-editors-field')).toBeInTheDocument();
- expect(screen.getByTestId('dashboard-viewers-field')).toBeInTheDocument();
+ expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
});
-test('renders tags field when TaggingSystem feature is enabled', () => {
+test('tags field is disabled when loading', () => {
mockedIsFeatureEnabled.mockImplementation(
(flag: any) => flag === FeatureFlag.TaggingSystem,
);
- render(<AccessSection {...defaultProps} />);
+ render(<AccessSection {...defaultProps} isLoading />);
expect(screen.getByTestId('dashboard-tags-field')).toBeInTheDocument();
Review Comment:
**Suggestion:** The test named for loading only checks field existence, so
it passes even when the tag selector remains enabled during loading.
[incomplete implementation]
**Assessment:** ๐ `Major` ยท ๐ `Occurrence: Sometimes`
[](https://docs.codeant.ai/cli/resolve-pr-comments-skill)
[](https://app.codeant.ai/fix-in-ide?tool=cursor&prompt_id=cad17a7ee71341d587dc9b579e0ca7e6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
[](https://app.codeant.ai/fix-in-ide?tool=vscode-claude&prompt_id=cad17a7ee71341d587dc9b579e0ca7e6&service=github&base_url=https%3A%2F%2Fgithub.com&org=apache&repo=apache%2Fsuperset)
<details>
<summary><b>Prompt for AI Agent ๐ค </b></summary>
```mdx
This is a comment left during a code review.
**Path:**
superset-frontend/src/dashboard/components/PropertiesModal/sections/AccessSection.test.tsx
**Line:** 97:99
**Comment:**
*Incomplete Implementation: The test named for loading only checks
field existence, so it passes even when the tag selector remains enabled during
loading.
Validate the correctness of the flagged issue. If correct, How can I resolve
this? If you propose a fix, implement it and please make it concise.
Once fix is implemented, also check other comments on the same PR, and ask
user if the user wants to fix the rest of the comments as well. if said yes,
then fetch all the comments validate the correctness and implement a minimal fix
```
</details>
<a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ac2134deecde7ab5773b0b40bff49f8daa1bc19416968df44f1b94f7d661da4a&reaction=like'>๐</a>
| <a
href='https://app.codeant.ai/feedback?pr_url=https%3A%2F%2Fgithub.com%2Fapache%2Fsuperset%2Fpull%2F44183&comment_hash=ac2134deecde7ab5773b0b40bff49f8daa1bc19416968df44f1b94f7d661da4a&reaction=dislike'>๐</a>
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]