| 1 | /** |
| 2 | * Copyright (c) Meta Platforms, Inc. and affiliates. |
| 3 | * |
| 4 | * This source code is licensed under the MIT license found in the |
| 5 | * LICENSE file in the root directory of this source tree. |
| 6 | */ |
| 7 | |
| 8 | import {render, screen} from '@testing-library/react'; |
| 9 | import {ThemedComponentsRoot} from '../ThemedComponentsRoot'; |
| 10 | import {ViewportOverlayRoot} from '../ViewportOverlay'; |
| 11 | import ComponentExplorer from '../explorer/ComponentExplorer'; |
| 12 | |
| 13 | describe('component library', () => { |
| 14 | it('renders component explorer', () => { |
| 15 | render( |
| 16 | <ThemedComponentsRoot theme="light"> |
| 17 | <ComponentExplorer /> |
| 18 | <ViewportOverlayRoot /> |
| 19 | </ThemedComponentsRoot>, |
| 20 | ); |
| 21 | |
| 22 | // the whole page appears |
| 23 | expect(screen.getByText('Component Explorer')).toBeInTheDocument(); |
| 24 | // some buttons appear |
| 25 | expect(screen.getAllByText('Primary').length).toBeGreaterThan(0); |
| 26 | }); |
| 27 | }); |
| 28 | |