Skip to content

Commit c967a27

Browse files
authored
Merge pull request #2952 from ably/web-4684-docs-nav-update
[WEB-4684] Core navigation component redesign (LeftSidebar, Header, RightSidebar)
2 parents 8d97b9d + 39a73bb commit c967a27

File tree

14 files changed

+1015
-756
lines changed

14 files changed

+1015
-756
lines changed

package.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@
4747
"@gfx/zopfli": "^1.0.15",
4848
"@intercom/messenger-js-sdk": "^0.0.14",
4949
"@mdx-js/react": "^2.3.0",
50+
"@radix-ui/react-accordion": "^1.2.12",
51+
"@radix-ui/react-dropdown-menu": "^2.1.16",
52+
"@radix-ui/react-tooltip": "^1.2.8",
5053
"@react-hook/media-query": "^1.1.1",
5154
"@sentry/gatsby": "^9.19.0",
5255
"@types/cheerio": "^0.22.31",

src/components/Layout/Header.test.tsx

Lines changed: 2 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -56,40 +56,19 @@ describe('Header', () => {
5656

5757
it('renders the header with logo and links', () => {
5858
render(<Header />);
59-
expect(screen.getAllByAltText('Ably logo').length).toBeGreaterThan(0);
59+
expect(screen.getByAltText('Ably')).toBeInTheDocument();
6060

61-
expect(screen.getByText('Docs')).toBeInTheDocument();
61+
expect(screen.getAllByText('Docs')).toHaveLength(2);
6262
expect(screen.getByText('Examples')).toBeInTheDocument();
6363
});
6464

65-
it('renders the search bar when searchBar is true', () => {
66-
render(<Header searchBar={true} />);
67-
expect(screen.getByText('SearchBar')).toBeInTheDocument();
68-
});
69-
70-
it('does not render the search bar when searchBar is false', () => {
71-
render(<Header searchBar={false} />);
72-
expect(screen.queryByText('SearchBar')).not.toBeInTheDocument();
73-
});
74-
7565
it('toggles the mobile menu when the burger icon is clicked', () => {
7666
render(<Header />);
7767
const burgerIcon = screen.getByText('icon-gui-bars-3-outline');
7868
fireEvent.click(burgerIcon);
79-
expect(screen.getByText('icon-gui-x-mark-outline')).toBeInTheDocument();
8069
expect(screen.getByText('LeftSidebar')).toBeInTheDocument();
8170
});
8271

83-
it('disables scrolling when the mobile menu is open', () => {
84-
render(<Header />);
85-
const burgerIcon = screen.getByText('icon-gui-bars-3-outline');
86-
fireEvent.click(burgerIcon);
87-
expect(document.body).toHaveClass('overflow-hidden');
88-
const closeIcon = screen.getByText('icon-gui-x-mark-outline');
89-
fireEvent.click(closeIcon);
90-
expect(document.body).not.toHaveClass('overflow-hidden');
91-
});
92-
9372
it('renders the sign in buttons when not signed in', () => {
9473
render(
9574
<UserContext.Provider value={{ sessionState: { signedIn: false }, apps: [] }}>

0 commit comments

Comments
 (0)