Skip to content

Commit b03da55

Browse files
committed
fix: sidebar test after navigation updates
1 parent c4a0fba commit b03da55

File tree

1 file changed

+10
-11
lines changed

1 file changed

+10
-11
lines changed

src/components/Layout/LeftSidebar.test.tsx

Lines changed: 10 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -96,17 +96,17 @@ describe('LeftSidebar', () => {
9696

9797
// Platform should be auto-expanded since active page is under Platform (index 0)
9898
await waitFor(() => {
99-
expect(screen.getByText('Introduction')).toBeInTheDocument();
99+
expect(screen.getByText('About Ably')).toBeInTheDocument();
100100
expect(screen.getByText('Architecture')).toBeInTheDocument();
101101
expect(screen.getByText('Products and SDKs')).toBeInTheDocument();
102102
});
103103

104104
// Verify these are clickable accordion triggers
105-
const introButton = screen.getByText('Introduction').closest('button');
105+
const aboutAblyButton = screen.getByText('About Ably').closest('button');
106106
const archButton = screen.getByText('Architecture').closest('button');
107107
const productsButton = screen.getByText('Products and SDKs').closest('button');
108108

109-
expect(introButton).toBeInTheDocument();
109+
expect(aboutAblyButton).toBeInTheDocument();
110110
expect(archButton).toBeInTheDocument();
111111
expect(productsButton).toBeInTheDocument();
112112
});
@@ -159,23 +159,22 @@ describe('LeftSidebar', () => {
159159
});
160160

161161
// Pub/Sub children should not be visible initially
162-
expect(screen.queryByText('Authentication')).not.toBeInTheDocument();
163-
expect(screen.queryByText('Connections')).not.toBeInTheDocument();
162+
expect(screen.queryByText('About Pub/Sub')).not.toBeInTheDocument();
163+
expect(screen.queryByText('Getting started')).not.toBeInTheDocument();
164164

165165
// Click on Ably Pub/Sub button to expand it (type="multiple" so Platform stays open)
166166
const pubsubButton = screen.getByRole('button', { name: 'Ably Pub/Sub' });
167167
await user.click(pubsubButton);
168168

169169
// After clicking, verify the Pub/Sub child accordion items appear
170-
// Note: "Introduction" appears in both Platform and Pub/Sub, so we check for items unique to Pub/Sub
171170
await waitFor(() => {
172-
expect(screen.getByText('Authentication')).toBeInTheDocument();
173-
expect(screen.getByText('Connections')).toBeInTheDocument();
171+
expect(screen.getByText('About Pub/Sub')).toBeInTheDocument();
172+
expect(screen.getByText('Getting started')).toBeInTheDocument();
174173
});
175174

176-
// Verify there are now 2 Introduction sections (one from Platform, one from Pub/Sub)
177-
const introductions = screen.getAllByText('Introduction');
178-
expect(introductions).toHaveLength(2);
175+
// Verify both product sections are visible (Platform has "About Ably", Pub/Sub has "About Pub/Sub")
176+
expect(screen.getByText('About Ably')).toBeInTheDocument();
177+
expect(screen.getByText('About Pub/Sub')).toBeInTheDocument();
179178

180179
// Platform's Architecture should still be visible since accordion type is "multiple"
181180
expect(screen.getByText('Architecture')).toBeInTheDocument();

0 commit comments

Comments
 (0)