Commit 756a0b4
committed
claude and gordon: add tests for light and dark logo
Claude got the syntax immediately, but not always the semantics, so I fixed those
and we iterated. Claude and came up with many interesting edge cases, some fixed in
adjacent commits. "Propose questions and answers, I'll choose the tests."
Preserving all "learnings" here. This is not slop, testing light & dark logo is an
ideal task for Claude!
This commit adds tests for dark/light logo variants in Quarto brand configurations:
Key learnings:
1. The dashboard format selects the medium size logo by default, not large
2. Direct path behavior:
- Strings without path/alt structure are treated as direct paths
- Alt text is empty when using direct path format without alt specification
- Named resources and direct paths can be mixed within a configuration
3. Fallback behavior:
- When a size is missing a dark variant, it doesn't fall back to its light variant
- Instead, it falls back to another size's dark variant (large.dark)
- This cross-size fallback behavior may need further specification
Tests include:
- dark-logo.qmd: Basic light/dark logo configuration
- override-dark-logo.qmd: Top-level logo overriding brand.logo
- explicit-dark-light-paths.qmd: Direct path specifications
- dark-logo-only.qmd: Fallback behavior testing
- mixed-logo-path.qmd: Mixed logo definitions (named resources and paths)
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
claude: Add comprehensive logo behavior tests
This commit adds tests exploring Quarto's logo behavior for dark/light modes:
Key learnings:
1. Small is the default logo size for dashboard navbar (not medium)
2. Logo resolution follows a mode-first search algorithm:
- Light mode searches small.light → medium.light → large.light
- Dark mode searches small.dark → medium.dark → large.dark
- It does NOT prioritize staying within same size and switching modes
3. When partial document-level overrides are used (e.g., only light or dark),
the non-overridden mode inherits from brand configuration
4. Direct path strings (without .path property) have empty alt text unless
explicitly provided via object syntax
5. Document-level logo settings take precedence over brand-level settings
Tests include:
- document-brand-precedence.qmd: Tests precedence between document and brand logos
- partial-document-override.qmd: Tests overriding only one light/dark variant
- mixed-specification-formats.qmd: Tests different logo specification formats
- cross-size-fallbacks.qmd: Tests fallback behavior when a specific mode is missing
- size-inheritance.qmd: Tests the mode-first search algorithm
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
claude: Add logo edge case tests
This commit adds tests for edge case logo behaviors:
Key learnings:
1. No recursive resolution of logo references is supported - Quarto does not follow
chains of references between logo resources
2. Format-specific logo configuration:
- Tests format.dashboard.logo taking precedence over document-level and brand logos
- Allows format-specific customization while maintaining generic defaults
3. Legacy logo syntax:
- A simple string logo value at document level applies to both light and dark modes
- Demonstrates backward compatibility with pre-dark-mode syntax
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
claude: Rename logo tests for better clarity
Renamed test files to more accurately reflect the behaviors they test:
- cross-size-fallbacks.qmd → mode-first-search-algorithm.qmd
Tests how light/dark modes independently search through size hierarchy
- size-inheritance.qmd → dark-mode-search-priority.qmd
Tests dark mode's search priority and lack of fallback to light mode
- dark-logo-only.qmd → missing-medium-dark-fallback.qmd
Tests specific fallback behavior when medium.dark is missing
- mixed-logo-path.qmd → mixed-resource-direct-path.qmd
Better describes the mix of resource references and direct paths
- mixed-specification-formats.qmd → path-vs-object-specification.qmd
Clarifies test comparing string paths vs object specifications with alt text
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
remove pngs
it's not necessary to have the files for the tests to run
claude: Add sidebar logo tests for size preference and mode-first search
This commit adds tests for sidebar logo behavior:
1. Size preference order test (sidebar/size-preference-order)
- Tests that sidebar logos follow the preference order: medium → small → large
- Verifies that when medium.dark is missing but small.dark and large.dark exist,
it correctly selects small.dark due to the preference order
2. Mode-first search algorithm test (sidebar/mode-first-search)
- Tests that light/dark modes independently search through all sizes
before considering the other mode
- Verifies that it searches through all sizes for dark mode before
considering any light mode variants
These tests confirm that sidebar logo behavior follows the same mode-first
search principles as dashboard logos, but with a different size preference
order (medium → small → large for sidebars vs medium → large → small for dashboard).
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
claude: Add navbar light/dark logo tests
This commit adds tests for navbar logo behavior with light/dark variants:
1. Size Preference Test:
- Tests navbar size preference order (small → medium → large)
- Verifies the mode-first search algorithm in a scenario with no small logos
- Confirms medium.light is selected for light mode when small is missing
- Confirms large.dark is selected for dark mode when small.dark is missing
2. Alt Text Consistency Test:
- Tests that alt text is properly inherited from brand definitions
- Confirms that missing resources get empty alt text
- Helps ensure accessibility attributes are maintained
3. Missing Logo Handling Test:
- Tests behavior when logo paths point to non-existent files
- Confirms img tags are generated with correct src attributes
- Ensures robust rendering even with missing resources
Key learnings:
- Navbar DOES NOT support document-level logo overrides unlike sidebars/dashboards
- Navbar follows the size preference order: small → medium → large (different from
sidebar: medium → small → large and dashboard: medium → large → small)
- Mode-first search applies to navbars: it exhaustively searches for a specific
mode (light/dark) across all sizes before falling back to other modes
🤖 Generated with [Claude Code](https://claude.ai/code)
Co-Authored-By: Claude <[email protected]>
claude: Add cross-mode logo fallback tests
This commit adds tests for how Quarto handles edge cases when logos are missing for
one theme mode but both light and dark modes are enabled:
1. dark-mode-no-dark-logo.qmd:
Tests what happens when dark mode is enabled but only light logo exists
2. dark-mode-no-light-logo.qmd:
Tests what happens when dark mode is enabled but only dark logo exists
3. document-light-brand-light-only.qmd:
Tests document-level light-only logo + brand with light-only logo
4. document-dark-brand-dark-only.qmd:
Tests document-level dark-only logo + brand with dark-only logo
Key learnings:
- Quarto implements cross-mode fallbacks where missing logos for one mode
automatically use logos from the other mode
- Implementation in brand.ts shows the fallback logic applies in both directions:
light → dark and dark → light
- Document-level logo settings take precedence over brand-level settings
- The fallback system ensures logos always appear regardless of which theme
mode is active, providing a consistent user experience
these tests do not support revealjs
default to other mode of logo1 parent 2880dfe commit 756a0b4
File tree
51 files changed
+939
-0
lines changed- tests/docs/smoke-all/brand/logo
- sidebar
- brand-default
- brand-override-alt
- brand-override-resources
- mode-first-search
- size-preference-order
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
51 files changed
+939
-0
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 36 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
Lines changed: 38 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
Lines changed: 39 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| 36 | + | |
| 37 | + | |
| 38 | + | |
| 39 | + | |
Lines changed: 31 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
| 31 | + | |
| 32 | + | |
| 33 | + | |
| 34 | + | |
| 35 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
| 29 | + | |
| 30 | + | |
0 commit comments