Show both symbol cuts in the showcase icon search
The search draws its 4,135 symbols as CSS masks through the symbol route, so the route learned `?optical=20` — the 24 cut otherwise, as on <x-icon> — and the section got a checkbox that switches the cut and draws the grid at 20px, where the difference in stroke weight is the point. Plan step 10; finding C16. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Qwx5USif3wFFmxtHg5U1g9
This commit is contained in:
co-authored by
Claude Fable 5.1
parent
699827d696
commit
1134dbac0b
@@ -92,6 +92,22 @@ it('serves a symbol for the icon search', function () {
|
||||
->assertSee('viewBox="0 -960 960 960"', false);
|
||||
});
|
||||
|
||||
it('serves the 24 cut by default and the 20 cut on request', function () {
|
||||
$geometry = function (string $folder): string {
|
||||
$svg = trim((string) file_get_contents(__DIR__."/../../resources/svg/symbols/{$folder}/home.svg"));
|
||||
|
||||
return substr($svg, (int) strpos($svg, '<path'));
|
||||
};
|
||||
|
||||
$standard = $this->get('/material/symbols/outlined/home.svg')->assertOk()->getContent();
|
||||
$dense = $this->get('/material/symbols/outlined/home.svg?optical=20')->assertOk()->getContent();
|
||||
|
||||
expect($dense)->not->toBe($standard)
|
||||
->and($standard)->toContain($geometry('outlined'))
|
||||
->and($dense)->toContain($geometry('outlined-20'))
|
||||
->and($this->get('/material/symbols/outlined/home.svg?optical=40')->getContent())->toBe($standard);
|
||||
});
|
||||
|
||||
it('answers 404 for a symbol or style that does not exist', function () {
|
||||
$this->get('/material/symbols/outlined/not_a_symbol_at_all.svg')->assertNotFound();
|
||||
$this->get('/material/symbols/sharp/favorite.svg')->assertNotFound();
|
||||
|
||||
Reference in New Issue
Block a user