-
Notifications
You must be signed in to change notification settings - Fork 48
Tests for workspace toolbar #1431
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
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.
Pull Request Overview
This PR adds comprehensive test coverage for the workspace toolbar component while removing a placeholder test file. The tests verify tab rendering, workspace selection, feature flag behavior, permission-based action visibility, and dialog interactions.
Key changes:
- Added complete test suite for
WorkspaceUsersToolbarcomponent with 5 test cases - Removed placeholder test file that had no implementation
Reviewed Changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| workspace-users-toolbar.component.test.tsx | New test file covering workspace toolbar functionality including tab rendering, feature flags, permissions, and user interactions |
| workspace-users-management.test.tsx | Removed empty placeholder test file |
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
web_ui/src/pages/user-management/workspaces/workspace-users-toolbar.component.test.tsx
Outdated
Show resolved
Hide resolved
web_ui/src/pages/user-management/workspaces/workspace-users-toolbar.component.test.tsx
Outdated
Show resolved
Hide resolved
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.
Pull Request Overview
Copilot reviewed 2 out of 2 changed files in this pull request and generated no new comments.
π‘ Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| expect(screen.getByRole('button', { name: 'Create workspace' })).toBeVisible(); | ||
| }); | ||
|
|
||
| it('renders fallback when permissions fail even with the feature flag enabled', async () => { |
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 don't check if the fallback is present, no?
|
|
||
| await screen.findAllByRole('tab'); | ||
|
|
||
| const createButton = await screen.findByRole('button', { name: 'Create workspace' }); |
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 believe screen.getByRole(...) would ok for this?
π Description
Added tests for workspace toolbar
β¨ Type of Change
Select the type of change your PR introduces:
π§ͺ Testing Scenarios
Describe how the changes were tested and how reviewers can test them too:
β Checklist
Before submitting the PR, ensure the following: