feat: design-system filters and global module ids in node-get/outline (S19)
Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01At3V6SjwbMe6eMzVGW3Hs7
This commit is contained in:
@@ -10,6 +10,7 @@ use LIT\MCP\Integrations\Divi\BlockTree\NodeIndex;
|
||||
use LIT\MCP\Integrations\Divi\BlockTree\NodeSummary;
|
||||
use LIT\MCP\Integrations\Divi\BlockTree\Outline;
|
||||
use LIT\MCP\Integrations\Divi\BlockTree\Parser;
|
||||
use LIT\MCP\Tests\Support\DiviFixtures;
|
||||
use PHPUnit\Framework\TestCase;
|
||||
use stdClass;
|
||||
|
||||
@@ -26,7 +27,7 @@ final class OutlineTest extends TestCase
|
||||
self::assertSame(
|
||||
['id' => 's0.r0.c1.m0', 'type' => 'heading', 'label' => '', 'excerpt' => 'Willkommen bei Müller & Söhne',
|
||||
'info' => '', 'presets' => ['Hero-Titel'], 'children' => 0, 'editable' => true, 'depth' => 3,
|
||||
'truncated' => false],
|
||||
'truncated' => false, 'global_id' => null],
|
||||
$rows[5]
|
||||
);
|
||||
self::assertSame('Spalten 8_24+16_24', $rows[1]['info']);
|
||||
@@ -40,6 +41,22 @@ final class OutlineTest extends TestCase
|
||||
);
|
||||
}
|
||||
|
||||
public function testGlobalInstancesShowTheirLibraryIdAndRootType(): void
|
||||
{
|
||||
$content = DiviFixtures::markup('stage3/page--globale-instanzen.html');
|
||||
$outline = new Outline();
|
||||
$rows = $outline->rows(NodeIndex::build((new Parser())->parse($content)));
|
||||
|
||||
$byId = array_column($rows, null, 'id');
|
||||
self::assertSame('1058', $byId['g0']['global_id']);
|
||||
self::assertSame('section', $byId['g0']['type']);
|
||||
self::assertFalse($byId['g0']['editable']);
|
||||
self::assertSame('1059', $byId['s0.r0.c0.g0']['global_id']);
|
||||
self::assertSame('text', $byId['s0.r0.c0.g0']['type']);
|
||||
self::assertNull($byId['s0']['global_id']);
|
||||
self::assertStringContainsString('g0 section "Global Abschnitt" [global 1058]', $outline->text($rows));
|
||||
}
|
||||
|
||||
public function testSubtreeAndDepthLimit(): void
|
||||
{
|
||||
$index = NodeIndex::build((new Parser())->parse($this->fixture('synthetic-basic.html')));
|
||||
@@ -104,7 +121,7 @@ final class OutlineTest extends TestCase
|
||||
$text = (new Outline())->text((new Outline())->rows($index));
|
||||
|
||||
self::assertStringContainsString('x0 core/paragraph (nur lesbar)', $text);
|
||||
self::assertStringContainsString('s1.g1 row "Globale Zeile" (nur lesbar)', $text);
|
||||
self::assertStringContainsString('s1.g1 row "Globale Zeile" [global 913] (nur lesbar)', $text);
|
||||
self::assertStringContainsString('s0 section [specialty]', $text);
|
||||
self::assertStringContainsString('s0.c1.r0 row-inner [Spalten 1_2+1_2]', $text);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user