Skip to content

Commit 41fc38d

Browse files
committed
test(studio): pin the search opening a closed group where the group keeps its state
Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 3148d1c commit 41fc38d

1 file changed

Lines changed: 13 additions & 5 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/StudioMenu.test.tsx‎

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -524,12 +524,20 @@ describe('drawn as the app\'s menu (objectstack#37452)', () => {
524524
expect(entry('type:object')).toBeVisible();
525525
});
526526

527+
// On ~all the groups are drawn flat with and without a search, so the
528+
// group the author closed is the same group the search lists into.
527529
it('a search lists its matches in a group the author closed', () => {
528-
renderAt(`/studio/${PKG}/data`);
529-
fireEvent.click(groupLabel('studio-menu-group-automation'));
530-
expect(screen.queryByTestId('studio-menu-entry-type:flow')).toBeNull();
531-
fireEvent.change(screen.getByTestId('studio-menu-search'), { target: { value: 'flow' } });
532-
expect(entry('type:flow')).toBeVisible();
530+
renderAt('/studio/~all/metadata', '~all');
531+
const label = groupLabel('studio-menu-group-security');
532+
fireEvent.click(label);
533+
expect(label).toHaveAttribute('aria-expanded', 'false');
534+
expect(screen.queryByTestId('studio-menu-entry-type:position')).toBeNull();
535+
fireEvent.change(screen.getByTestId('studio-menu-search'), { target: { value: 'position' } });
536+
expect(entry('type:position')).toBeVisible();
537+
expect(groupLabel('studio-menu-group-security')).toHaveAttribute('aria-expanded', 'true');
538+
// The author's choice is kept: clearing the search closes it again.
539+
fireEvent.change(screen.getByTestId('studio-menu-search'), { target: { value: '' } });
540+
expect(screen.queryByTestId('studio-menu-entry-type:position')).toBeNull();
533541
});
534542

535543
it('an entry draws a bare line icon before its name, on the app menu\'s row', () => {

0 commit comments

Comments
 (0)