TestToolsetMetadataHasIcons ensures all toolsets have icons defined. This is a policy test - if you want to allow toolsets without icons, you can remove or modify this test.
(t *testing.T)
| 67 | // This is a policy test - if you want to allow toolsets without icons, |
| 68 | // you can remove or modify this test. |
| 69 | func TestToolsetMetadataHasIcons(t *testing.T) { |
| 70 | // These toolsets are expected to NOT have icons (internal/special purpose) |
| 71 | exceptionsWithoutIcons := map[string]bool{ |
| 72 | "all": true, // Meta-toolset |
| 73 | "default": true, // Meta-toolset |
| 74 | } |
| 75 | |
| 76 | inv, err := NewInventory(stubTranslator).Build() |
| 77 | require.NoError(t, err) |
| 78 | toolsets := inv.AvailableToolsets() |
| 79 | |
| 80 | for _, ts := range toolsets { |
| 81 | if exceptionsWithoutIcons[string(ts.ID)] { |
| 82 | continue |
| 83 | } |
| 84 | t.Run(string(ts.ID), func(t *testing.T) { |
| 85 | assert.NotEmpty(t, ts.Icon, "toolset %s should have an icon defined", ts.ID) |
| 86 | }) |
| 87 | } |
| 88 | } |
nothing calls this directly
no test coverage detected