mirror of
https://github.com/olehomelchenko/astrolabe.git
synced 2026-08-08 02:02:33 +00:00
Chart builder: drop unparseable expressions mid-edit, polite glyphed inline feedback
This commit is contained in:
@@ -256,8 +256,15 @@ describe('ChartBuilderModal', () => {
|
||||
await Promise.resolve();
|
||||
});
|
||||
|
||||
const alert = container.querySelector('[role="alert"]');
|
||||
expect(alert?.textContent).toMatch(/nexpected|Invalid/);
|
||||
// Polite, not assertive: live per-keystroke validation uses role="status" with a
|
||||
// status glyph, never an assertive alert (council: APG Alert / WCAG 2.2.4).
|
||||
const messages = Array.from(container.querySelectorAll('[role="status"]'));
|
||||
const errorMsg = messages.find((n) => /nexpected|Invalid/.test(n.textContent ?? ''));
|
||||
expect(errorMsg).toBeTruthy();
|
||||
// The expression input is linked to its message and flagged invalid.
|
||||
const exprInput = container.querySelector('input[aria-label="Filter expression"]');
|
||||
expect(exprInput?.getAttribute('aria-invalid')).toBe('true');
|
||||
expect(exprInput?.getAttribute('aria-describedby')).toBe(errorMsg?.id);
|
||||
});
|
||||
|
||||
test('the Vega expression reference shows only when an expression is in play (1E)', async () => {
|
||||
|
||||
Reference in New Issue
Block a user