-
Notifications
You must be signed in to change notification settings - Fork 407
feat: [UIE-9358] - IAM Parent/Child: Child Account - Default Entity Access #12993
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
Merged
aaleksee-akamai
merged 6 commits into
linode:develop
from
aaleksee-akamai:UIE-9358-iam-default-entity-access-tab
Oct 22, 2025
Merged
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
ccfa7e4
feat: [UIE-9358] - IAM Parent/Child: Child Account - Default Entity Aβ¦
aaleksee-akamai 15ff36b
move logic to the hook
aaleksee-akamai 7222784
fix assigned default roles
aaleksee-akamai e23cfb0
test and filter out assigned roles
aaleksee-akamai 386bae2
remove useMemo
aaleksee-akamai 99eb855
Merge branch 'develop' into UIE-9358-iam-default-entity-access-tab
aaleksee-akamai File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
60 changes: 60 additions & 0 deletions
60
packages/manager/src/features/IAM/Roles/Defaults/DefaultEntityAccess.test.tsx
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,60 @@ | ||
| import { screen } from '@testing-library/react'; | ||
| import React from 'react'; | ||
|
|
||
| import { renderWithTheme } from 'src/utilities/testHelpers'; | ||
|
|
||
| import { DefaultEntityAccess } from './DefaultEntityAccess'; | ||
|
|
||
| const queryMocks = vi.hoisted(() => ({ | ||
| useAllAccountEntities: vi.fn().mockReturnValue({}), | ||
| useParams: vi.fn().mockReturnValue({}), | ||
| useSearch: vi.fn().mockReturnValue({}), | ||
| useGetDefaultDelegationAccessQuery: vi.fn().mockReturnValue({}), | ||
| useIsDefaultDelegationRolesForChildAccount: vi | ||
| .fn() | ||
| .mockReturnValue({ isDefaultDelegationRolesForChildAccount: true }), | ||
| })); | ||
|
|
||
| vi.mock('src/features/IAM/hooks/useDelegationRole', () => ({ | ||
| useIsDefaultDelegationRolesForChildAccount: | ||
| queryMocks.useIsDefaultDelegationRolesForChildAccount, | ||
| })); | ||
|
|
||
| vi.mock('@linode/queries', async () => { | ||
| const actual = await vi.importActual<any>('@linode/queries'); | ||
|
Check warning on line 24 in packages/manager/src/features/IAM/Roles/Defaults/DefaultEntityAccess.test.tsx
|
||
| return { | ||
| ...actual, | ||
| useGetDefaultDelegationAccessQuery: | ||
| queryMocks.useGetDefaultDelegationAccessQuery, | ||
| }; | ||
| }); | ||
|
|
||
| vi.mock('src/queries/entities/entities', async () => { | ||
| const actual = await vi.importActual('src/queries/entities/entities'); | ||
| return { | ||
| ...actual, | ||
| useAllAccountEntities: queryMocks.useAllAccountEntities, | ||
| }; | ||
| }); | ||
|
|
||
| vi.mock('@tanstack/react-router', async () => { | ||
| const actual = await vi.importActual('@tanstack/react-router'); | ||
| return { | ||
| ...actual, | ||
| useParams: queryMocks.useParams, | ||
| useSearch: queryMocks.useSearch, | ||
| }; | ||
| }); | ||
|
|
||
| describe('DefaultEntityAccess', () => { | ||
| it('should render', async () => { | ||
| renderWithTheme(<DefaultEntityAccess />); | ||
|
|
||
| expect( | ||
| screen.getByText('Default Entity Access for Delegate Users') | ||
| ).toBeVisible(); | ||
| expect(screen.getByPlaceholderText('Search')).toBeVisible(); | ||
| expect(screen.getByPlaceholderText('All Entities')).toBeVisible(); | ||
| expect(screen.getByRole('table')).toBeVisible(); | ||
| }); | ||
| }); | ||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
No change needed, but eventually we may just allow
location.pathnamehere.. It was done this way becauselocation.pathnameisn't type strict as the other router utils, but it does make sense to have it set as such