addons/components/__tests__/basic.test.tsxblame
View source
b69ab311/**
b69ab312 * Copyright (c) Meta Platforms, Inc. and affiliates.
b69ab313 *
b69ab314 * This source code is licensed under the MIT license found in the
b69ab315 * LICENSE file in the root directory of this source tree.
b69ab316 */
b69ab317
b69ab318import {render, screen} from '@testing-library/react';
b69ab319import {ThemedComponentsRoot} from '../ThemedComponentsRoot';
b69ab3110import {ViewportOverlayRoot} from '../ViewportOverlay';
b69ab3111import ComponentExplorer from '../explorer/ComponentExplorer';
b69ab3112
b69ab3113describe('component library', () => {
b69ab3114 it('renders component explorer', () => {
b69ab3115 render(
b69ab3116 <ThemedComponentsRoot theme="light">
b69ab3117 <ComponentExplorer />
b69ab3118 <ViewportOverlayRoot />
b69ab3119 </ThemedComponentsRoot>,
b69ab3120 );
b69ab3121
b69ab3122 // the whole page appears
b69ab3123 expect(screen.getByText('Component Explorer')).toBeInTheDocument();
b69ab3124 // some buttons appear
b69ab3125 expect(screen.getAllByText('Primary').length).toBeGreaterThan(0);
b69ab3126 });
b69ab3127});