fix: admin UI review round 1 (S47) - Art labels, usage only on success, result fallback
- Art column: only lit/media-delete and lit/divi-delete say "löscht", lit/post-trash "Papierkorb", other destructive tools "überschreibt". - ConnectionUsage records only responses with status < 400 (mcp-oauth answers auth failures with WP_REST_Response 401, not WP_Error). - Log result column: translated "unbekannt" instead of the raw value. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com>
This commit is contained in:
@@ -255,16 +255,45 @@ final class ToolsTabTest extends TestCase
|
||||
$registry = new IntegrationRegistry($this->integration('media', [
|
||||
['lit/media-preview', true, true],
|
||||
['lit/media-upload', false, false],
|
||||
['lit/media-delete', false, false, true],
|
||||
]));
|
||||
|
||||
$html = $this->render([], $registry);
|
||||
|
||||
self::assertStringContainsString('<th scope="col" class="column-kind">Art</th>', $html);
|
||||
self::assertStringContainsString('liest', $this->row($html, 'lit/media-preview'));
|
||||
self::assertStringContainsString('schreibt', $this->row($html, 'lit/media-upload'));
|
||||
self::assertStringContainsString('löscht', $this->row($html, 'lit/media-delete'));
|
||||
self::assertStringNotContainsString('schreibt', $this->row($html, 'lit/media-delete'));
|
||||
self::assertStringContainsString('dashicons-visibility', $this->row($html, 'lit/media-preview'));
|
||||
self::assertStringContainsString('>liest<', $this->row($html, 'lit/media-preview'));
|
||||
self::assertStringContainsString('dashicons-edit', $this->row($html, 'lit/media-upload'));
|
||||
self::assertStringContainsString('>schreibt<', $this->row($html, 'lit/media-upload'));
|
||||
}
|
||||
|
||||
/**
|
||||
* "destructive" is a broad hint (deleting, replacing, swapping) – only explicit deletes say "löscht".
|
||||
*
|
||||
* @dataProvider destructiveAbilities
|
||||
*/
|
||||
public function testArtColumnForEveryDestructiveAbility(string $name, string $icon, string $word): void
|
||||
{
|
||||
$registry = new IntegrationRegistry($this->integration('wordpress', [[$name, false, false, true]]));
|
||||
|
||||
$row = $this->row($this->render([], $registry), $name);
|
||||
|
||||
self::assertStringContainsString('dashicons-' . $icon, $row);
|
||||
self::assertStringContainsString('>' . $word . '<', $row);
|
||||
}
|
||||
|
||||
/** @return list<list<string>> */
|
||||
public static function destructiveAbilities(): array
|
||||
{
|
||||
return [
|
||||
['lit/media-delete', 'trash', 'löscht'],
|
||||
['lit/divi-delete', 'trash', 'löscht'],
|
||||
['lit/post-trash', 'trash', 'Papierkorb'],
|
||||
['lit/post-replace-with-copy', 'update', 'überschreibt'],
|
||||
['lit/revision-restore', 'update', 'überschreibt'],
|
||||
['lit/menu-set-items', 'update', 'überschreibt'],
|
||||
['lit/menu-assign-location', 'update', 'überschreibt'],
|
||||
['lit/divi-replace-text', 'update', 'überschreibt'],
|
||||
];
|
||||
}
|
||||
|
||||
public function testToolCellShowsLabelAndTheNameAsMutedTextWithALabelledSelect(): void
|
||||
|
||||
Reference in New Issue
Block a user