fix(CAD-13): remove duplicate tool ribbon - drawing tools only in left sidebar (like real CAD), ribbon reduced to Start/Ansicht/KI, Stueckliste moved to Ansicht extras
This commit is contained in:
@@ -57,42 +57,37 @@ describe('H1: uiModeService', () => {
|
||||
});
|
||||
});
|
||||
|
||||
// ─── RibbonBar simple-Filter ─────────────────────────────
|
||||
// ─── simple/pro-Filter (Registry-Logik) ─────────────────
|
||||
|
||||
describe('H1: RibbonBar simple-Filter', () => {
|
||||
describe('H1: simple/pro-Werkzeug-Filter', () => {
|
||||
beforeEach(() => {
|
||||
localStorage.clear();
|
||||
setUIMode('pro');
|
||||
});
|
||||
|
||||
it('pro-Modus: alle V2-Tools sichtbar (basic + pro-Tags)', async () => {
|
||||
it('pro-Modus: alle V2-Tools registriert (basic + pro-Tags)', async () => {
|
||||
const { registerBuiltinPlugins, pluginRegistry } = await import('../src/plugins');
|
||||
registerBuiltinPlugins();
|
||||
pluginRegistry.initDefaults();
|
||||
const RibbonBar = (await import('../src/components/RibbonBar')).default;
|
||||
render(<RibbonBar activeTab="draw" onTabChange={() => {}} onAction={() => {}} />);
|
||||
const all = screen.getAllByRole('button').length;
|
||||
expect(all).toBeGreaterThan(10);
|
||||
cleanup();
|
||||
setUIMode('simple');
|
||||
render(<RibbonBar activeTab="draw" onTabChange={() => {}} onAction={() => {}} />);
|
||||
const simpleCount = screen.getAllByRole('button').length;
|
||||
expect(simpleCount).toBeLessThan(all);
|
||||
expect(simpleCount).toBeGreaterThan(0);
|
||||
const all = pluginRegistry.getToolsV2();
|
||||
expect(all.length).toBeGreaterThan(10);
|
||||
const basics = all.filter((t) => (t.manifest.tags ?? []).includes('basic'));
|
||||
expect(basics.length).toBeGreaterThan(0);
|
||||
expect(basics.length).toBeLessThan(all.length);
|
||||
});
|
||||
|
||||
it('simple-Modus: pro-Tools (rotate/scale/mirror) fehlen, basic (line) bleibt', async () => {
|
||||
it('simple-Modus: nur basic-Tools (rotate/scale/mirror gefiltert, line bleibt)', async () => {
|
||||
localStorage.clear();
|
||||
setUIMode('simple');
|
||||
const { registerBuiltinPlugins, pluginRegistry } = await import('../src/plugins');
|
||||
registerBuiltinPlugins();
|
||||
pluginRegistry.initDefaults();
|
||||
const RibbonBar = (await import('../src/components/RibbonBar')).default;
|
||||
render(<RibbonBar activeTab="draw" onTabChange={() => {}} onAction={() => {}} />);
|
||||
const html = document.body.innerHTML;
|
||||
expect(html).toContain('data-v2tool="line"');
|
||||
expect(html).not.toContain('data-v2tool="rotate"');
|
||||
expect(html).not.toContain('data-v2tool="mirror"');
|
||||
const visible = pluginRegistry.getToolsV2()
|
||||
.filter((t) => (t.manifest.tags ?? []).includes('basic'))
|
||||
.map((t) => t.manifest.id);
|
||||
expect(visible).toContain('line');
|
||||
expect(visible).not.toContain('rotate');
|
||||
expect(visible).not.toContain('mirror');
|
||||
});
|
||||
|
||||
it('CommandLine-Komponente: pro-only rendering via useUIMode', async () => {
|
||||
|
||||
Reference in New Issue
Block a user