Publish curated ITWorx-Pulse source from 0e0633c8ac91cb71312a26837f791035a78d81b8
Public source validation / validate (push) Failing after 2m10s
Public source validation / validate (push) Failing after 2m10s
This commit is contained in:
1 parent
a4956c2af9
commit
db8093b608
88 files changed
+3685
-469
No files matched your search
@@ -1,4 +1,4 @@
|
||||
import { render, screen } from '@testing-library/react';
|
||||
import { render, screen, within } from '@testing-library/react';
|
||||
import userEvent from '@testing-library/user-event';
|
||||
import { describe, expect, it, vi } from 'vitest';
|
||||
|
||||
@@ -64,6 +64,22 @@ describe('interactive widgets', () => {
|
||||
expect(document.body).not.toHaveTextContent(rawKey);
|
||||
});
|
||||
|
||||
it('supports series toggles, bounded zoom, a pointer crosshair and annotations', async () => {
|
||||
const user = userEvent.setup();
|
||||
const view = render(<MetricWidget {...props({ kind: 'timeseries', series: [
|
||||
{ key: 'tower', points: [{ ...freshPoint, timestamp: now - 30_000 }, freshPoint] },
|
||||
{ key: 'backup', points: [{ ...freshPoint, timestamp: now - 30_000, labels: { host: 'backup' } }, { ...freshPoint, labels: { host: 'backup' } }] },
|
||||
], annotations: [{ id: 'incident-1', label: 'Opslagincident', timestamp: now, tone: 'critical' }] })} />);
|
||||
const widget = within(view.container);
|
||||
const backup = widget.getByRole('button', { name: 'backup' });
|
||||
expect(backup).toHaveAttribute('aria-pressed', 'true');
|
||||
await user.click(backup);
|
||||
expect(backup).toHaveAttribute('aria-pressed', 'false');
|
||||
await user.click(widget.getByRole('button', { name: 'Zoom op recente helft' }));
|
||||
expect(widget.getByRole('button', { name: 'Volledige periode' })).toHaveAttribute('aria-pressed', 'true');
|
||||
expect(widget.getByRole('list', { name: 'Incident- en meldingsannotaties' })).toHaveTextContent('Opslagincident');
|
||||
});
|
||||
|
||||
it('supports keyboard activation of ranked rows', async () => {
|
||||
const onSelect = vi.fn();
|
||||
render(<RankedListWidget items={[{ id: 'disk-1', label: 'Disk 1', value: '78%' }]} onSelect={onSelect} />);
|
||||
|
||||
Reference in new issue
Block a user