Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 8 additions & 0 deletions src/ui/device-images.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -256,6 +256,14 @@ test("Noir Gear M2-NEX resolves to its maintainer-hosted artwork", () => {
assert.equal(deviceImage(null, "NOIR E1"), CDN + "noir-e1.png");
});

test("Noir Gear M1-NEX resolves to its reserved maintainer-hosted artwork", () => {
assert.equal(deviceImage(null, "M1-NEX"), CDN + "noir-m1-nex.png");
assert.equal(deviceImage(null, "Noir Gear M1-NEX"), CDN + "noir-m1-nex.png");
// Neighboring Noir Gear models must not match the M1-NEX render.
assert.equal(deviceImage(null, "Noir M1"), CDN + "unknown-device.png");
assert.equal(deviceImage(null, "Noir M1 Lite"), CDN + "unknown-device.png");
});

test("Noir S1 resolves to the reserved maintainer-hosted artwork filename", () => {
assert.equal(deviceImage(null, "NOIR S1"), CDN + "noir-s1.png");
assert.equal(deviceImage(null, "Noir Gear / NOIR S1"), CDN + "noir-s1.png");
Expand Down
3 changes: 3 additions & 0 deletions src/ui/device-images.ts
Original file line number Diff line number Diff line change
Expand Up @@ -173,6 +173,9 @@ function resolveDeviceImageFilename(_device: HIDDevice | null | undefined, displ
// retail shell. Keep its artwork match name-based so USB and 2.4 GHz
// receiver connections resolve to the same product image.
if (/m2\s*[-_]?\s*nex/i.test(displayName)) return "noir-m2-nex.png";
// M1-NEX wired support uses Noir Gear's own reported model name. Match the
// full model token so Noir M1 and M1 Lite keep their own artwork/placeholder.
if (/\bm1\s*[-_]?\s*nex\b/i.test(displayName)) return "noir-m1-nex.png";
if (/\bnoir\s*e1\b/i.test(displayName)) return "noir-e1.png";
if (/fantech/i.test(displayName)) return "unknown-device.png";
return "unknown-device.png";
Expand Down
Loading