Преглед на файлове

feature: display p2s artwork (#3369)

Andy Sorge преди 2 дни
родител
ревизия
a9b72e6b6b
променени са 3 файла, в които са добавени 8 реда и са изтрити 5 реда
  1. BIN
      frontend/public/img/printers/p2s.png
  2. 7 4
      frontend/src/__tests__/utils/printer.test.ts
  3. 1 1
      frontend/src/utils/printer.ts

BIN
frontend/public/img/printers/p2s.png


+ 7 - 4
frontend/src/__tests__/utils/printer.test.ts

@@ -74,10 +74,13 @@ describe('getPrinterImage', () => {
       expect(getPrinterImage('H2D Pro')).toBe('/img/printers/h2dpro.png');
     });
 
-    it('P2S → p1s.png (shared with P1S)', () => {
-      // Pre-existing behaviour: P2S currently reuses the P1S artwork. Not
-      // changed by the X2D diff; asserted to catch accidental regressions.
-      expect(getPrinterImage('P2S')).toBe('/img/printers/p1s.png');
+    it('P2S → p2s.png', () => {
+      expect(getPrinterImage('P2S')).toBe('/img/printers/p2s.png');
+    });
+
+    it('P1S → p1s.png', () => {
+      // Ensure that P1S still resolves correctly
+      expect(getPrinterImage('P1S')).toBe('/img/printers/p1s.png');
     });
 
     it('A1 Mini → a1mini.png (not a1.png)', () => {

+ 1 - 1
frontend/src/utils/printer.ts

@@ -9,7 +9,7 @@ export function getPrinterImage(model: string | null | undefined): string {
   if (m.includes('h2d')) return '/img/printers/h2d.png';
   if (m.includes('h2c')) return '/img/printers/h2c.png';
   if (m.includes('h2s')) return '/img/printers/h2d.png';
-  if (m.includes('p2s')) return '/img/printers/p1s.png';
+  if (m.includes('p2s')) return '/img/printers/p2s.png';
   if (m.includes('p1s')) return '/img/printers/p1s.png';
   if (m.includes('p1p')) return '/img/printers/p1p.png';
   if (m.includes('a2l') || m === 'n9') return '/img/printers/a2l.png';