fix: PresetComposer liest nur den von der Ability bereinigten Namen
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
co-authored by
Claude Opus 5.5
parent
3d760113ec
commit
d5fd1642b8
@@ -95,7 +95,7 @@ final class PresetComposerTest extends TestCase
|
||||
$existing['attrs'] = ['button' => ['decoration' => ['border' => ['desktop' => ['value' => ['radius' => '4px']]]]]];
|
||||
|
||||
$result = self::composer()->compose(self::book(), new PresetScope('module', 'divi/button'), $existing, [
|
||||
'rename' => 'CTA Primär',
|
||||
'name' => 'CTA Primär',
|
||||
'attrs' => ['button.decoration.background' => ['desktop' => ['color' => '#000000']]],
|
||||
], 'items[0]', null);
|
||||
|
||||
@@ -105,6 +105,22 @@ final class PresetComposerTest extends TestCase
|
||||
self::assertSame('4px', $result['item']['attrs']['button']['decoration']['border']['desktop']['value']['radius']);
|
||||
}
|
||||
|
||||
/** Final review M-5: the ability resolves name/rename; the composer only takes "name" as given. */
|
||||
public function testOnlyTheResolvedNameCounts(): void
|
||||
{
|
||||
$existing = self::book()->items(new PresetScope('module', 'divi/button'))['aaaaaaaaaa'];
|
||||
|
||||
$kept = self::composer()->compose(self::book(), new PresetScope('module', 'divi/button'), $existing, [
|
||||
'rename' => 'Ignoriert',
|
||||
], 'items[0]', null);
|
||||
$missing = self::composer()->compose(self::book(), new PresetScope('module', 'divi/button'), null, [
|
||||
'rename' => 'Ignoriert',
|
||||
], 'items[0]', null);
|
||||
|
||||
self::assertSame('CTA primär', $kept['item']['name']);
|
||||
self::assertSame('Name des neuen Presets fehlt', $missing['errors']['items[0].name']);
|
||||
}
|
||||
|
||||
public function testFromNodeTakesTheDesignButNotTheContent(): void
|
||||
{
|
||||
$node = Block::create('divi/button', [
|
||||
|
||||
Reference in New Issue
Block a user