Skip to content

Commit bca58d4

Browse files
committed
test(studio): the Access shield is the permission-set entry's icon now that group labels draw none
Claude-Session: https://claude.ai/code/session_01Utp6CbL6Nn3scsU8yvLyU4 Co-authored-by: Claude <noreply@anthropic.com>
1 parent 41fc38d commit bca58d4

1 file changed

Lines changed: 8 additions & 7 deletions

File tree

‎ui/packages/app-shell/src/views/studio-design/StudioDesignSurface.accessSegment-12452.test.tsx‎

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,9 @@
1212
* read on the menu:
1313
*
1414
* 1. The menu's Access group holds the permission-set entry, a real router
15-
* link, with no "More" trigger anywhere; the group carries the shield glyph,
16-
* the Data group's is not it.
15+
* link, with no "More" trigger anywhere; that entry carries the shield
16+
* glyph, the Data group's object entry does not (objectstack#37452: a
17+
* group's label draws no glyph, each entry draws its own line icon).
1718
* 2. With the Access pillar's address open (under any package id) — which
1819
* lands on the list of sets since objectstack#36905 — that entry is the
1920
* current page and carries the active state; with Data open it carries
@@ -30,7 +31,7 @@ import * as React from 'react';
3031
import { describe, it, expect, vi, beforeEach, afterEach } from 'vitest';
3132
import { render, screen, cleanup, within } from '@testing-library/react';
3233
import { MemoryRouter, Route, Routes, useLocation } from 'react-router-dom';
33-
import { ShieldCheck } from 'lucide-react';
34+
import { Shield } from 'lucide-react';
3435

3536
const PKG = 'com.acme.app';
3637

@@ -208,9 +209,9 @@ function renderAt(path: string) {
208209
const menu = () => screen.getByTestId('studio-menu');
209210
const entry = (testId: string) => within(menu()).getByTestId(testId);
210211

211-
/** The markup of lucide's own `ShieldCheck`, the Access group's glyph. */
212+
/** The markup of lucide's own `Shield`, the permission-set entry's glyph. */
212213
function shieldMarkup(): string {
213-
const { container, unmount } = render(<ShieldCheck />);
214+
const { container, unmount } = render(<Shield />);
214215
const markup = container.querySelector('svg')!.innerHTML;
215216
unmount();
216217
return markup;
@@ -230,8 +231,8 @@ describe('Studio menu: Access is a group of its own, and More is gone (objectui#
230231
expect(screen.queryByTestId('studio-nav-more')).toBeNull();
231232
expect(screen.queryByTestId('studio-pillar-nav')).toBeNull();
232233
const shield = shieldMarkup();
233-
expect(group.querySelector('svg')!.innerHTML).toBe(shield);
234-
expect(within(menu()).getByTestId('studio-menu-group-data').querySelector('svg')!.innerHTML).not.toBe(shield);
234+
expect(within(group).getByTestId(PERMISSION_ENTRY).querySelector('svg')!.innerHTML).toBe(shield);
235+
expect(entry(OBJECT_ENTRY).querySelector('svg')!.innerHTML).not.toBe(shield);
235236
});
236237

237238
it.each(['app.objectstack.hotcrm', PKG])('with Access open in %s, the permission-set entry is the current page', async (pkg) => {

0 commit comments

Comments
 (0)