Files
clide/test/extension/src/contribution_test.dart
T
jpmschweitzerandClaude Opus 4.6 46329700d5 dissolve app/ into repo root (D-056)
Single Flutter package at the repo root. All code, tests, assets,
and platform directories moved from app/ to root. Package renamed
from clide_app to clide — all imports rewritten. Merged pubspec
combines core (ffi) and app (flutter, yaml, xterm) dependencies.
Makefile simplified: no APP_PRESENT conditionals, no cd, no daemon
lifecycle. 317 tests pass.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-04-23 00:37:20 +02:00

63 lines
1.8 KiB
Dart

import 'package:clide/clide.dart';
import 'package:clide/extension/extension.dart';
import 'package:clide/kernel/kernel.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
group('ContributionPoint sealed hierarchy', () {
test('TabContribution exposes slot + title + i18n fields', () {
final t = TabContribution(
id: 'welcome.view',
slot: Slots.workspace,
title: 'Welcome',
titleKey: 'tab.title',
i18nNamespace: 'builtin.welcome',
priority: -100,
build: (_) => const SizedBox.shrink(),
);
expect(t.id, 'welcome.view');
expect(t.slot, Slots.workspace);
expect(t.title, 'Welcome');
expect(t.titleKey, 'tab.title');
expect(t.i18nNamespace, 'builtin.welcome');
expect(t.priority, -100);
});
test('StatusItemContribution pins the statusbar slot', () {
final s = StatusItemContribution(
id: 'ipc-status.indicator',
build: (_) => const SizedBox.shrink(),
);
expect(s.slot, Slots.statusbar);
});
test('CommandContribution has no slot', () {
final c = CommandContribution(
id: 'theme.pick',
command: 'theme.pick',
run: (_) async => IpcResponse.ok(id: '', data: const {}),
);
expect(c.slot, isNull);
});
test('TrayItemContribution pins the tray slot', () {
final t = TrayItemContribution(
id: 't',
label: 'Label',
onSelected: () {},
);
expect(t.slot, Slots.tray);
});
test('ToolbarButtonContribution pins the toolbar slot', () {
final b = ToolbarButtonContribution(
id: 'save',
label: 'Save',
onPressed: () {},
);
expect(b.slot, Slots.toolbar);
});
});
}