Scopes: Allow navigating to inner containers (#89676)

Scopes: Allow navigating to inner levels after selecting a scope
This commit is contained in:
Bogdan Matei 2024-06-25 18:31:31 +03:00 committed by GitHub
parent a3879e02bb
commit 0ea2d6972f
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 4 additions and 5 deletions

View File

@ -38,7 +38,6 @@ import {
mocksScopes,
queryAllDashboard,
queryFiltersApply,
queryApplicationsClustersSlothClusterNorthTitle,
queryApplicationsClustersTitle,
queryApplicationsSlothPictureFactoryTitle,
queryApplicationsSlothVoteTrackerTitle,
@ -137,12 +136,14 @@ describe('ScopesScene', () => {
expect(getFiltersInput().value).toBe('slothVoteTracker, slothPictureFactory, Cluster Index Helper');
});
it("Can't navigate deeper than the level where scopes are selected", async () => {
it('Can select a node from an inner level', async () => {
await userEvents.click(getFiltersInput());
await userEvents.click(getApplicationsExpand());
await userEvents.click(getApplicationsSlothVoteTrackerSelect());
await userEvents.click(getApplicationsClustersExpand());
expect(queryApplicationsClustersSlothClusterNorthTitle()).not.toBeInTheDocument();
await userEvents.click(getApplicationsClustersSlothClusterNorthSelect());
await userEvents.click(getFiltersApply());
expect(getFiltersInput().value).toBe('slothClusterNorth');
});
it('Can select a node from an upper level', async () => {

View File

@ -36,7 +36,6 @@ export function ScopesTreeLevel({
const scopeNames = scopes.map(({ scopeName }) => scopeName);
const anyChildExpanded = childNodesArr.some(({ isExpanded }) => isExpanded);
const anyChildSelected = childNodesArr.some(({ linkId }) => linkId && scopeNames.includes(linkId!));
const onQueryUpdate = useMemo(() => debounce(onNodeUpdate, 500), [onNodeUpdate]);
@ -102,7 +101,6 @@ export function ScopesTreeLevel({
{childNode.isExpandable && (
<IconButton
disabled={anyChildSelected && !childNode.isExpanded}
name={!childNode.isExpanded ? 'angle-right' : 'angle-down'}
aria-label={
childNode.isExpanded ? t('scopes.tree.collapse', 'Collapse') : t('scopes.tree.expand', 'Expand')