Skip to content

Commit 2ec4312

Browse files
committed
test(console): pin an app's book-name and doc-name docs URLs in the app shell
Claude-Session: https://claude.ai/code/session_01QSeKYnagJvGbCtNg2PhvgW Co-authored-by: Claude <noreply@anthropic.com>
1 parent 827b3c7 commit 2ec4312

1 file changed

Lines changed: 16 additions & 0 deletions

File tree

‎ui/apps/console/src/pages/docs-portal.test.tsx‎

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1063,6 +1063,22 @@ describe('objectstack#37150 — from 768 px up an app\'s docs pages draw in the
10631063
expect(within(column).getByRole('button', { name: /Leads Book/ })).toBeInTheDocument();
10641064
expect(within(column).queryByRole('button', { name: /Alpha Manual/ })).toBeNull();
10651065
});
1066+
1067+
// The package container's other URL forms (objectui#11197): a book NAME,
1068+
// a book NAME with its doc, and a segment that is both a doc's name and a
1069+
// book's name each land where they did, now in the shell.
1070+
it.each([
1071+
['a book NAME', '/apps/com.example.showcase/docs/showcase_manual', '/apps/com.example.showcase/docs/manual/showcase_index', 'INDEX BODY'],
1072+
['a book NAME with its doc', '/apps/com.example.showcase/docs/showcase_manual/showcase_lead_guide', '/apps/com.example.showcase/docs/manual/showcase_lead_guide', 'LEAD BODY'],
1073+
['a doc name that is also a book name (the doc permalink wins)', '/apps/com.example.showcase/docs/showcase_lead_guide', '/apps/com.example.showcase/docs/manual/showcase_lead_guide', 'LEAD BODY'],
1074+
['the canonical SLUG/DOC', '/apps/com.example.showcase/docs/manual/showcase_lead_guide', '/apps/com.example.showcase/docs/manual/showcase_lead_guide', 'LEAD BODY'],
1075+
])('%s, %s, lands on %s in the shell', async (_what, entry, where, body) => {
1076+
render(<InShell entry={entry} />);
1077+
expect(await screen.findByTestId('doc-content')).toHaveTextContent(body);
1078+
expect(screen.getByTestId('where')).toHaveTextContent(where);
1079+
expect(within(sidebar()).getByTestId('docs-nav')).toBeInTheDocument();
1080+
expect(within(page()).queryByTestId('docs-nav')).toBeNull();
1081+
});
10661082
});
10671083

10681084
it('CONTROL — without the shell\'s sidebar (a phone; the /docs portal) the page draws its column and its back link itself', async () => {

0 commit comments

Comments
 (0)