Add projects
This commit is contained in:
parent
2d3a9ad623
commit
8b607dd700
1802 changed files with 503346 additions and 2 deletions
27
frontend/tests/configTabsAccessibility.test.ts
Normal file
27
frontend/tests/configTabsAccessibility.test.ts
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
import { describe, expect, test } from 'vitest';
|
||||
import { createElement } from 'react';
|
||||
import { renderToStaticMarkup } from 'react-dom/server';
|
||||
import i18n from '@/i18n';
|
||||
import { ConfigTabs } from '@/features/config/components/ConfigTabs';
|
||||
|
||||
const noop = () => {};
|
||||
|
||||
describe('ConfigTabs accessibility', () => {
|
||||
test('announces validation errors and unsaved changes in the tab name', () => {
|
||||
const markup = renderToStaticMarkup(
|
||||
createElement(ConfigTabs, {
|
||||
active: 'common',
|
||||
errorCounts: { streaming: 2 },
|
||||
dirtyTabs: new Set(['streaming']),
|
||||
onChange: noop,
|
||||
})
|
||||
);
|
||||
const accessibleLabel = [
|
||||
i18n.t('config_management.visual.sections.streaming.title'),
|
||||
i18n.t('config_management.meta_errors', { count: 2 }),
|
||||
i18n.t('config_management.status_dirty_short'),
|
||||
].join(', ');
|
||||
|
||||
expect(markup).toContain(`aria-label="${accessibleLabel}"`);
|
||||
});
|
||||
});
|
||||
Loading…
Reference in a new issue