Skip to content

SigNoz is an open-source, OpenTelemetry-native observability platform for your team and their AI agents. Get logs, metrics, and traces in one tool with features like APM, distributed tracing, log management, infra monitoring, etc. Combined with SigNoz MCP and a native AI teammate (in SigNoz Cloud) it helps you build more resilient apps.

875 B
Raw Blame
import { expect, within } from 'storybook/test';

import { PANEL_NAME } from '../__story_mockdata__/constants';

import { PANEL_LOAD, type PanelPlayArgs } from './args';

export const expectText = async (
	root: HTMLElement,
	args: PanelPlayArgs,
): Promise<void> => {
	const panel = await within(root).findByTestId('text-panel', {}, PANEL_LOAD);
	const body = within(panel);

	await expect(
		body.getByRole('heading', { name: 'Checkout runbook' }),
	).toBeInTheDocument();
	await expect(body.getAllByRole('listitem')).toHaveLength(3);
	await expect(
		body.getByRole('link', { name: 'payments dashboard' }),
	).toBeInTheDocument();
	await expect(panel.querySelector('pre code')).toHaveTextContent(
		'kubectl scale',
	);

	await expect(getComputedStyle(panel).textAlign).toBe(args.textAlign);

	await expect(within(root).getByText(PANEL_NAME.Text)).toBeInTheDocument();
};