Browse Source

fix tech description

Alexander Musikhin 21 hours ago
parent
commit
6a202f2ef9

+ 1 - 1
resources/views/common_catalog/edit.blade.php

@@ -230,7 +230,7 @@
                             <div class="alert alert-light border mb-0 mt-3 py-2">
                                 @if($canViewTechnicalDescriptionPrice)
                                     Цена для DOCX: <strong>{{ $technicalDescriptionPriceLabel }}</strong> —
-                                    <strong>{{ $item->{$technicalDescriptionPriceField.'_txt'} }}</strong>
+                                    <strong>{{ str_replace('&nbsp;', "\u{00A0}", $item->{$technicalDescriptionPriceField.'_txt'}) }}</strong>
                                 @else
                                     Цена для DOCX скрыта вашими правами доступа.
                                 @endif

+ 13 - 0
tests/Feature/CommonCatalogControllerTest.php

@@ -274,6 +274,19 @@ class CommonCatalogControllerTest extends TestCase
             ->assertSeeText('Калькуляция');
     }
 
+    public function test_technical_description_price_uses_a_non_breaking_space_instead_of_an_html_entity(): void
+    {
+        $item = CommonCatalogItem::factory()->create([
+            'project_price' => 434800,
+        ]);
+
+        $this->actingAs($this->admin)
+            ->get(route('common-catalog.show', $item))
+            ->assertOk()
+            ->assertSee("434\u{00A0}800.00₽", false)
+            ->assertDontSee('&amp;nbsp;', false);
+    }
+
     public function test_admin_can_edit_technical_description_fields(): void
     {
         $item = CommonCatalogItem::factory()->create();